Skip to content

Commit ae76f46

Browse files
author
ac133451
committed
matlab example update
1 parent 6902f72 commit ae76f46

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

examples/matlab_example.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
global send_socket
22
send_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

56
send_socket.start()
67
rec_socket.start()
@@ -13,5 +14,6 @@
1314

1415
function echo_back(data)
1516
global send_socket;
17+
data % print data
1618
send_socket.send_data(data);
1719
end

examples/matlab_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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)
1818
rec_socket = TCPReceiveSocket(tcp_port=receive_port, handler_function=print_data)
1919

2020
# start the sockets

0 commit comments

Comments
 (0)