特牛网址导航

python实现socket通讯(UDP)-CSDN博客

网友收藏
文章浏览阅读10w+次,点赞4次,收藏58次。Server: 1 import socket 2 3 address = ('127.0.0.1', 31500) 4 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 5 s.bind(address) 6 7 while True: 8 data, addr = s.recvfrom(2048) 9 if not data: 10