Example application demonstrating the TCP server API of the WiConnect Host Library

Dependencies:   WiConnect mbed

tcp_client.py

Committer:
dan_ackme
Date:
2014-08-26
Revision:
0:19d3a6600a5a

File content as of revision 0:19d3a6600a5a:

import socket
 
ECHO_SERVER_ADDRESS = "192.168.1.52"
ECHO_PORT = 7
 
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 
s.connect((ECHO_SERVER_ADDRESS, ECHO_PORT))
 
s.sendall('Hello, world')
data = s.recv(1024)
print 'Received', repr(data)
s.close()