问题描述
嗨 TcpClient Hi TcpClient client = new TcpClient ( " 192.168.1.24 2" ,11000); 这篇关于PDA上的Compact Framework,Listening Socket - 无法连接到它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
我试图在运行Windows CE 5.0的PDA上创建一个服务器套接字。
一切似乎都很好,但我无法从Vista中的Test应用程序连接到PDA 。
我的测试应用程序非常简单,如下所示:
Iam trying to create a Server socket on a PDA running Windows CE 5.0.
Everything seems to instantiate fine, however i cannot connect to the PDA from my Test application in Vista.
My test application is very simply with a line like this: public void acceptCallback(IAsyncResult ar)
{
Socket listener = (Socket)ar.AsyncState;
Socket handler = listener.EndAccept(ar);
listener.Send(Encoding.ASCII.GetBytes("ABC<EOF>"));
MessageBox.Show("ACCEPTED: " + handler.RemoteEndPoint.ToString());
// Additional code to read data goes here.
}
private void button7_Click(object sender, EventArgs e)
{
IPEndPoint localEP = new IPEndPoint(IPAddress.Any, 11000);
Socket server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
server.Bind(localEP);
server.Listen(5);
server.BeginAccept(acceptCallback, server);
}
推荐答案