我正在尝试在 Raspberry Pi 3 上运行我的第一个 IoT。
但是使用这段代码......
public void StartServer()
{
Task.Run(async () =>
{
listener = new StreamSocketListener();
listener.Control.KeepAlive = true;
listener.Control.NoDelay = true;
await listener.BindServiceNameAsync(port.ToString());
});
}
我在 BindServiceNameAsync 处收到此错误...
Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.ni.dll
WinRT information: Only one usage of each socket address (protocol/network address/port)
is normally permitted.
在 appmanifest 中,我检查了“Internet(客户端和服务器)”。
知道为什么我会收到此错误吗?
谢谢
最佳答案
很可能您尝试使用的端口已被另一个进程使用。尝试不同的端口。
关于windows-10-iot-core - 物联网 : Only one usage of each socket address (protocol/network address/port) is normally permitted,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36711541/