File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 11global send_socket
22send_socket = TCPSendSocket(4343 , ' 0.0.0.0' );
3- rec_socket = TCPReceiveSocket(4242 ,' 0.0.0.0' ,@echo_back );
3+ rec_socket = TCPReceiveSocket(4242 ,' 127.0.0.1' ,@echo_back );
4+ % use '127.0.0.1' for windows and 'localhost' for unix systems
45
56send_socket .start()
67rec_socket .start()
1314
1415function echo_back(data )
1516 global send_socket ;
17+ data % print data
1618 send_socket .send_data(data );
1719end
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ def print_data(data):
1414
1515
1616# create a send and receive socket
17- send_socket = TCPSendSocket (tcp_port = send_port , tcp_ip = ip , send_type = JSON )
17+ send_socket = TCPSendSocket (tcp_port = send_port , tcp_ip = '' , send_type = JSON )
1818rec_socket = TCPReceiveSocket (tcp_port = receive_port , handler_function = print_data )
1919
2020# start the sockets
You can’t perform that action at this time.
0 commit comments