TCP Client Connection Pass/Fail
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Rob A
el 14 de Dic. de 2020
Respondida: Rob A
el 14 de Dic. de 2020
I am looking for a pass/fail status the the initial TCP connection.
% If the TCP connection is successful then variable 't' is created.
% If it's not successful, then the variable 't' is not created, BUT the
% code execution is also aborted so the if statement below is never executed.
t = tcpclient('192.168.1.15', 52801);
if exist('t','var')
disp('TCP Connection setup');
else
disp('TCP Connection not setup');
end
When the TCP connection is unsuccessful, an error message is generated in the console, and the code execution is aborted. This is the error message in the console:
Error using Untitled (line 2)
Cannot create a communication link with the remote server. Please check the input arguments(ADDRESS and PORT) and make sure the server is running.
Additional Information: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Is there another way to check that status of a tcp connection with the Instrument Control Toolbox? (i.e. A ping command that doesn't require the "MATLAB Compiler SDK").
Thank you!
Rob
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!