mirror of https://github.com/ARMmbed/mbed-os.git
12 lines
232 B
Python
12 lines
232 B
Python
|
import socket
|
||
|
|
||
|
ECHO_PORT = 7
|
||
|
|
||
|
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||
|
sock.bind(('', ECHO_PORT))
|
||
|
|
||
|
while True:
|
||
|
data, address = sock.recvfrom(256)
|
||
|
print "datagram from", address
|
||
|
sock.sendto(data, address)
|