ACKme Logo WiConnect Host Library- API Reference Guide
 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
tcp_client.py
1 import socket
2 
3 ECHO_SERVER_ADDRESS = "192.168.1.52"
4 ECHO_PORT = 7
5 
6 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
7 s.connect((ECHO_SERVER_ADDRESS, ECHO_PORT))
8 
9 s.sendall('Hello, world')
10 data = s.recv(1024)
11 print 'Received', repr(data)
12 s.close()