- server:
- def udpServer():
- address = ('', 9527)
- srvsock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- srvsock.bind(address)
- #data,addr = srvsock.recvfrom(2048)
- if __name__ == "__main__":
- udpServer()
- client:
- def udpClient():
- address = ('localhost', 9527)
- clisock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- #clisock.sendto(data, address)
- if __name__ == "__main__":
- udpClient()