复制
收藏
提问
全网

import socket UDP_PORT = 6666 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind(('', UDP_PORT)) while True: data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes print("received message from %s: %s" % (addr, data.decode()))注释

漂亮造型师
2个月前
全网
文档
学术
百科
知识库
时间不限
自动

理解问题import socket UDP_PORT = 6666 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind(('', UDP_PORT)) while True: data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes print("received message from %s: %s" % (addr, data.decode()))注释

已完成理解import socket UDP_PORT = 6666 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind(('', UDP_PORT)) while True: data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes print("received message from %s: %s" % (addr, data.decode()))注释

展开阅读网页

更专业一些
转笔记
专业
import socket UDP_PORT = 6666 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind(('', UDP_PORT)) while True: data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes print("received message from %s: %s" % (addr, data.decode()))注释
不在提醒

更专业内容正在努力生成中
知识树
import socket UDP_PORT = 6666 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind(('', UDP_PORT)) while True: data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes print("received message from %s: %s" % (addr, data.decode()))注释
UDP服务器如何处理多客户端?
UDP与TCP主要区别是什么?
如何提高UDP数据传输的可靠性?

以上内容由AI搜集生成,仅供参考

在线客服