Saumya Agarwal

Saumya Agarwal

  • NA
  • 82
  • 525

Communication for sending data between pocket pc and pc

Mar 21 2018 5:36 AM
Hi,
 
I am sending data over wifi through socket connection to communicate between pocket pc and pc but unable to do it.
 
The connection is refused. The same i can send when connecting via bluetooth.
 
My code for connecting is as follows:
 
Client: Pocket pc
  1. RemoteClient remoteClient = new RemoteClient(ipaddress, Int32.Parse(port));  
  2. remoteClient.myEvent += new RemoteClient.EventDelegate(this.RemoteClient_MessageReceived);  
  3. remoteClient.SendMessage(tag.TagID);  
  4. Server:  
  5. / listen on port m_serverPort  
  6. TcpListener tcpServer = new TcpListener(m_serverPort);  
  7. // report where we are  
  8. IPHostEntry thisHost = Dns.Resolve(Dns.GetHostName());  
  9. ShowMessage(String.Format("Host {0} listening on {1}, port {2}",  
  10. thisHost.HostName, thisHost.AddressList[0].ToString(), m_serverPort));  
  11. tcpServer.Start();  
  12. TcpClient clientConn = tcpServer.AcceptTcpClient();  
  13. // Send back a message  
  14. response = m_sendMessageText;  
Please let me know for any other details needed.
 
Help...urgent!!!
Thanks,
Saumya

Answers (1)