windows-10-iot-core - 物联网 : Only one usage of each socket address (protocol/network address/port) is normally permitted

标签 windows-10-iot-core windowsiot

我正在尝试在 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/

相关文章:

visual-studio-2015 - SpeechRecognizer 无法工作,COMException : Class not registered/UWP App Windows IoT (10. 0.10586) 和 Visual Studio 2015 Update 1

c# - 使用 C# 在 Windows IOT 和 Arduino Nano 之间进行 I2C 连接

c# - 禁用 WindowsIoT 屏幕键盘文本框自动更正

node.js - Windows 物联网 - Mongodb - 覆盆子

c++ - 为 Win IoT Core 构建 ARM 会出现 "not supported"错误

c# - 如何使用Windows IOT获取Raspberry PI 2的处理器序列号

c++ - Raspberry Pi 2 某些 GPIO 引脚不工作

raspberry-pi2 - Windows 10 IoT 上的 USB 移动宽带调制解调器?

c# - Win10 IoT + RPI3 WiFiAdapter 抛出 Access Denied

c# - 如何从 Windows 10 IoT 托管临时 802.11 网络