使用C#编码连接两台计算机
我想用c#编码连接2台电脑..
我想要一台电脑作为服务器而另一台作为客户端工作..
我知道一些套接字编程以及..
我读了如何在msdn库中创建一个同步服务器和客户端这里 ..我使用的是那里提到的相同代码..
这两台电脑都有一个实时IP地址,并且不在任何局域网网络上..
我一直在客户端程序中的此异常..
SocketException:System.Net.Sockets.SocketException:连接尝试失败
因为连接方没有正确响应一段时间后,或建立的连接失败,因为连接的主机无法响应122 。162.98.164:11000
在System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,SocketAddress socketAddress)
在System.Net.Sock ets.Socket.Connect(EndPoint remoteEP)
at consoleclient.Program.Main(String [] args)in C:\ Users\mukul \Desktop\consol
eclient\consoleclient\Program。
i want to connect 2 computers using c# coding..
i want one computer to work as a server and other one as a client..
i know some socket programming as well..
i read how to create a synchronous server and client in msdn library here .. i am using the same code mentioned there..
both the computer have a live ip address and are not on any LAN network..
i keep getting this exception in the client program..
SocketException : System.Net.Sockets.SocketException: A connection attempt failed
because the connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to respond 122 .162.98.164:11000
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sock ets.Socket.Connect(EndPoint remoteEP)
at consoleclient.Program.Main(String[] args) in C:\Users\mukul\Desktop\consol
eclient\consoleclient\Program.
您可以在同一台计算机上运行客户端和服务器,并确保客户端可以连接吗?
Can you run both your client and server on the same machine, and make sure that the client can connect?