I have made a chat client using TCPListener for server and TCPClient for client it works perfectly fine on localhost.
However it is unable to send message over a ad-hoc network. I have tried everything i can think of.
1.Firewalls allow the application to run on both computers.
2.Even disabling firewalls on both computers doesn't work.
3.I have pinged both the computers from each other and the packets reach fine.
Please guys immediate help is required.
Code for the server
TCPListener listen = new TCPListener(IPAddress.any,port);
TCPClient client = listen.AcceptTcpClient();
and then i make networkstream, streamreader and streamwriter from it.
For the client
TCPClient client = new TCPClient("127.0.0.1",port);
NetworkStream stream = client.GetStream();
and then i make streamreader,streamwriter from it.
As i said before this codes works perfectly on localhost but for some reason doesn't work on a ad-hoc network.