<s> '''<STR_LIT>''' <EOL> import time <EOL> from socket import AF_INET , SOCK_STREAM , socket <EOL> from thread import start_new <EOL> import struct <EOL> HOST = '<STR_LIT:localhost>' <EOL> PORT = <NUM_LIT:1000> <EOL> BUFSIZE = <NUM_LIT> <EOL> ADDR = ( HOST , PORT ) <EOL> client = socket ( AF_INET , SOCK_STREAM ) <EOL> client . connect ( ADDR ) <EOL> def sendData ( sendstr , commandId ) : <EOL> HEAD_0 = chr ( <NUM_LIT:0> ) <EOL> HEAD_1 = chr ( <NUM_LIT:0> ) <EOL> HEAD_2 = chr ( <NUM_LIT:0> ) <EOL> HEAD_3 = chr ( <NUM_LIT:0> ) <EOL> ProtoVersion = chr ( <NUM_LIT:0> ) <EOL> ServerVersion = <NUM_LIT:0> <EOL> sendstr = sendstr <EOL> data = struct . pack ( '<STR_LIT>' , HEAD_0 , HEAD_1 , HEAD_2 , HEAD_3 , ProtoVersion , ServerVersion , len ( sendstr ) + <NUM_LIT:4> , commandId ) <EOL> senddata = data + sendstr <EOL> return senddata <EOL> def resolveRecvdata ( data ) : <EOL> head = struct . unpack ( '<STR_LIT>' , data [ : <NUM_LIT> ] ) <EOL> length = head [ <NUM_LIT:6> ] <EOL> data = data [ <NUM_LIT> : <NUM_LIT> + length ] <EOL> return data <EOL> s1 = time . time ( ) <EOL> def start ( ) : <EOL> while True : <EOL> client . sendall ( sendData ( '<STR_LIT:0>' , <NUM_LIT:1> ) ) <EOL> start ( ) </s>
