finish
This commit is contained in:
11
UDP Ping程序实现/lab4.py
Normal file
11
UDP Ping程序实现/lab4.py
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
from socket import *
|
||||
|
||||
########## Begin ##########
|
||||
clientSocket = socket(AF_INET, SOCK_DGRAM) # 创建UDP套接字,使用IPv4协议
|
||||
# 设置套接字超时值1秒
|
||||
clientSocket.settimeout(1)
|
||||
########## End ##########
|
||||
|
||||
print(clientSocket)
|
||||
print(clientSocket.gettimeout())
|
||||
Reference in New Issue
Block a user