UDP echo client using the WiConnect Library and mbed UDP Socket API.

Dependencies:   WiConnect mbed

udp_echo_server.py

Committer:
dan_ackme
Date:
2014-08-26
Revision:
1:6053abbb65c5
Parent:
0:0675bde9bdd5

File content as of revision 1:6053abbb65c5:

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)