able to recieve packets
This commit is contained in:
parent
848d14f790
commit
81faf3bd45
1 changed files with 11 additions and 1 deletions
|
|
@ -1 +1,11 @@
|
||||||
print("hello World")
|
import socket
|
||||||
|
|
||||||
|
UDP_IP = "127.0.0.1"
|
||||||
|
UDP_PORT = 4444
|
||||||
|
|
||||||
|
sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
|
||||||
|
sock.bind((UDP_IP,UDP_PORT))
|
||||||
|
|
||||||
|
while True:
|
||||||
|
data, addr = sock.recvfrom(1024)
|
||||||
|
print("received mesage: %s" % data)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue