Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from socketwrapper import TCPSocket
- import sys, select
- def read_line():
- if len(select.select([sys.stdin],[],[],0.001)) > 0:
- return raw_input()
- return None
- connected = True
- def on_disconnect():
- print "Disconnected"
- connected = False
- sock = TCPSocket("118.90.57.247", 10200, on_disconnect)
- while connected:
- data = sock.Receive()
- if data != None:
- print data
- line = read_line()
- if line != None:
- sock.Send(line)
Add Comment
Please, Sign In to add comment