Direction error when using UDPReceiver on port 6666

조회 수: 2 (최근 30일)
Alejandro González
Alejandro González 2016년 12월 25일
댓글: Alejandro González 2016년 12월 31일
I have a problem that I am unable to solve or to find an explanation for. Let's say I have a small useless code in file 'tmp.m':
udpr = dsp.UDPReceiver('LocalIPPort',6666,'MessageDataType','int8');
step(udpr);
I would like to run it now. If I do so using the Matlab IDE, the code is executed and I don't have any problem with it. However, if I want to run it using the Matlab Command Window (by using the command "start "Matlab" /b %myMatlabRute% -r "tmp" -nodesktop") I get the following error:
Error using UDPReceiver/step
Solo se permite un uso de cada dirección de socket (protocolo/dirección de red/puerto)
Error in tmp (line 2)
step(udpr);
The second line of the error would translate as "Each socket is allowed to be used in just one direction (protocol/direction of the network/port)".
Does anyone know why this could happen?

채택된 답변

Hari Desanur
Hari Desanur 2016년 12월 29일
I ran the above "dsp.UDPReceiver" code in the "tmp.m" file from within the MATLAB IDE and then opened another session of MATLAB from the command line with the '-nodesktop' option.
Now if run the "tmp.m" function in the '-nodesktop' version I was able to see the error which you are getting. Then I closed the original MATLAB IDE session and ran the "tmp.m" file from within the '-nodesktop' version and I was not able to see the same error.
I think we are getting that error because when we run the 'tmp.m' file from both the '-nodesktop' and 'desktop' version of MATLAB at the same time we are trying to setup 2 receivers using the same port.
  댓글 수: 1
Alejandro González
Alejandro González 2016년 12월 31일
You are absolutly right. Because I'm always working with both things open I didn't catch the problem. Thank you very much for your help

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Eye Tracking에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by