Effacer les filtres
Effacer les filtres

How to solve "Unsuccessful read: tcpip Timeout"

5 vues (au cours des 30 derniers jours)
MD
MD le 7 Mar 2019
Hello, everybody,
I have a Matlab (R2018a) error or a warning I'm desperate for right now. I want to send a message (or command) via TCP/IP to a server and then read the answer again. I do this as follows:
write1= '<Commandxyz/>';
write2 = '<Command123/>';
t = tcpip('172.31.1.1xx', 61xx);
pause(2)
fopen(t);
pause(2)
fprintf(t, write1);
pause(2)
read1=fscanf(t, '%s')
fprintf(t, write2);
pause(2)
read2=fscanf(t, '%s')
pause(2)
fclose(t);
delete(t);
clear t
Sometimes the transfer works but in most cases I get the following warning and an empty array back:
Warning: Unsuccessful read: A timeout occurred before the Terminator was reached.
'tcpip' unable to read all requested data. For more information on possible reasons, see TCPIP Read Warnings.
Does anyone have any idea how I can get this problem solved? I have tried to insert pauses everywhere but that didn't help either.
Thank you very much!

Réponses (1)

Pruthvi Muppavarapu
Pruthvi Muppavarapu le 11 Mar 2019
The following link addresses the possible causes of error and a way to resolve them:
Hope this answers your query.

Catégories

En savoir plus sur Install Products dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by