why it always apears “Address already in use: Cannot bind”?

48 次查看(过去 30 天)
x=udp('192.168.2.20',166, 'LocalPort', 5030);
x.inputbuffersize=414720;
fopen(x);
fwrite(x,'get');
data=fread(x);
fclose(x);
  1 个评论
Walter Roberson
Walter Roberson 2018-6-11
Try quitting MATLAB and trying again: you might have an old connection sitting around from a previous attempt.

请先登录,再进行评论。

回答(1 个)

Pulkit Goel
Pulkit Goel 2020-7-3
You may have an older connection still alive. Try quitting MATLAB and try again.
You can also turn 'EnablePortSharing' on to make a connection even if the port is already in use.
x.EnablePortSharing = 'on';

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by