2

我正在尝试在我的 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(客户端和服务器)”。

知道为什么我会收到此错误吗?

谢谢

4

1 回答 1

2

您尝试使用的端口很可能已被另一个进程使用。尝试不同的端口。

于 2016-05-05T04:29:58.057 回答