为什么net.socket.connect在Win10下不工作(在Win7下工作)?

时间:2019-03-14 17:09:36

标签: c# winsockets

使用此代码

IPEndPoint remoteEp = new IPEndPoint(ipAddress, port);
this._sender = new Socket(ipAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
this._sender.Connect(remoteEp);

在win7下可以正常连接到另一台计算机。

使用Win10会引发错误: enter image description here

翻译:由于目标计算机拒绝了连接,因此无法建立连接。

有什么办法解决这个问题吗?

编辑: 防火墙关闭,ping工作正常,我使用一个不同的IP4地址,服务器ist正在运行(并正确回答了win7机器)。

在此先感谢 彼得

0 个答案:

没有答案
相关问题