Hello everyone,
I am trying to benchmark pnet toolbox for sending and receiving both tcp/udp messages between the machines. My goal is to measure the throughput and latency for different pay-load sizes.
I wanted some advice on getting the basic loop of the script running. I wrote the following code for the listener:
sPort = '1234';
if ((sPort > 1024))
tcpCon = pnet('tcpsocket', sPort);
else
tcpCon = -1;
end
serv = pnet(tcpCon,'tcplisten');
try
pnet(tcpCon, 'close');
catch exception
retCode = 1;
end
But I get the error:
??? Error using ==> pnet
Invalid socket for LISTEN, Already open, or UDP?...
Error in ==> test_pnet at 24
serv = pnet(tcpCon,'tcplisten');
Can someone please guide me to what could be the problem. If anyone has a simple working sender/receiver script that I could develop on that would be great!