Tcpclient function very slow.
Here is the example tcpclient I use. I it takes 2.3 seconds to send the command. Can anyone let me know what I am doing wrong.
commandstr = ‘echo’
tic
t = tcpclient(‘localhost’,Portnumber);
t.ByteOrder = "big-endian";
% configureTerminator(t,"CR/LF")
write(t ,length(commandstr),’uint32′);
write(t,commandstr);
BytesToRead = read(t,1,’uint32′);
B = read(t,BytesToRead,’string’);
command_sent = strip(B);
clear t
toc
Elapsed time is 2.353485 seconds.Here is the example tcpclient I use. I it takes 2.3 seconds to send the command. Can anyone let me know what I am doing wrong.
commandstr = ‘echo’
tic
t = tcpclient(‘localhost’,Portnumber);
t.ByteOrder = "big-endian";
% configureTerminator(t,"CR/LF")
write(t ,length(commandstr),’uint32′);
write(t,commandstr);
BytesToRead = read(t,1,’uint32′);
B = read(t,BytesToRead,’string’);
command_sent = strip(B);
clear t
toc
Elapsed time is 2.353485 seconds. Here is the example tcpclient I use. I it takes 2.3 seconds to send the command. Can anyone let me know what I am doing wrong.
commandstr = ‘echo’
tic
t = tcpclient(‘localhost’,Portnumber);
t.ByteOrder = "big-endian";
% configureTerminator(t,"CR/LF")
write(t ,length(commandstr),’uint32′);
write(t,commandstr);
BytesToRead = read(t,1,’uint32′);
B = read(t,BytesToRead,’string’);
command_sent = strip(B);
clear t
toc
Elapsed time is 2.353485 seconds. tcpclient MATLAB Answers — New Questions