C#客户端未连接到IPv6地址 [英] C# Client not connecting to IPv6 address

查看:125
本文介绍了C#客户端未连接到IPv6地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经建立了一个C#客户端-服务器应用程序.客户端使用其IP地址连接到在远程计算机上运行的服务器.我已将System.Net.Socket.TCPClient用于客户端,并将System.Net.Socket.TCPListener用于服务器.

对于正常的IPv4地址,该应用程序正常运行,但是当我尝试连接至IPv6地址时,它将失败.客户端引发以下异常:未找到此类主机.

请帮忙.

Hi,

I have built a C# client-server application. The client connects to the server running on a remote machine by using its IP Address. I have used System.Net.Socket.TCPClient for client and System.Net.Socket.TCPListener for the server.

The application is wokring fine for normal IPv4 address, but when i try to connect to an IPv6 address it fails. The client throws the following exception: No such Hosts Found.

Please help.

推荐答案

Microsoft的一个示例
There''s a sample from Microsoft here[^] that gives a clear solution you might use as a reference. One thing I note is that the article is for .Net 4. It''s possible that previous versions of the TCP-related methods don''t work with the IPv6 standards, and you may be using an earlier version for your development. If so, try rebuilding the solution using .Net 4 and see if that changes anything.


这篇关于C#客户端未连接到IPv6地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆