Files
CN-Educoder/UDP Ping程序实现/lab4.py
Yunjay Liu 809b1b1cd3 finish
2024-10-25 22:03:45 +08:00

12 lines
274 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from socket import *
########## Begin ##########
clientSocket = socket(AF_INET, SOCK_DGRAM) # 创建UDP套接字使用IPv4协议
# 设置套接字超时值1秒
clientSocket.settimeout(1)
########## End ##########
print(clientSocket)
print(clientSocket.gettimeout())