import sys
sys.path.append('../..')


import report
import socket_protocol
from socket_protocol_server import example_protocol, DID_ASC_TIME
import tcp_socket
import time

if __name__ == '__main__':
    report.stdoutLoggingConfigure(log_name_lvl=[('root', 'INFO'), ])
    c = tcp_socket.tcp_client_stp('127.0.0.1', 17017)
    sp = example_protocol(c, channel_name='example_client')
    sp.send(socket_protocol.SID_READ_REQUEST, DID_ASC_TIME, None)
    print('The Client received: %s' % repr(sp.receive(socket_protocol.SID_READ_RESPONSE, 0).get_data()))
