Created
April 27, 2022 09:13
-
-
Save QZLin/7dcec08e16256e80a01401c137871175 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
ip_port = ('', 9999) | |
server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
server.bind(ip_port) | |
while True: | |
data, addr = server.recvfrom(1024) | |
print('Received:', data.decode()) | |
# server.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment