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

Dependencies:   WiConnect mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers tcp_client.py Source File

tcp_client.py

00001 import socket
00002  
00003 ECHO_SERVER_ADDRESS = "192.168.1.52"
00004 ECHO_PORT = 7
00005  
00006 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 
00007 s.connect((ECHO_SERVER_ADDRESS, ECHO_PORT))
00008  
00009 s.sendall('Hello, world')
00010 data = s.recv(1024)
00011 print 'Received', repr(data)
00012 s.close()