Forums Register Login

Socket connection program works for localhost but not for other ip

+Pie Number of slices to send: Send
Hi all, I have one socket connection program as
// For server



//for client



when I run this program it create connection and send and data from server successfully. But when I use other machine IP as

Socket sock = new Socket("10.22.35.32",13267);

then on client machine it shows error as connection time-out. and there is no connection established between server and client. Why is it so? I started server program on one pc and run client program from another pc.
+Pie Number of slices to send: Send
When I interchange client and server then it works perfectly. But not work for other combination why is it so?
+Pie Number of slices to send: Send
Sounds like a networking issue. Make sure you can ping the server machine from the client machine. If that works use telnet to check if you can connect to it: If that already fails then something is blocking access, probably a firewall either on the server machine, on the client machine or on a router between the two.
+Pie Number of slices to send: Send
Thanks Rob for response. Yes because of firewall it is blocking access.
+Pie Number of slices to send: Send
Then you need to add exceptions to the firewall, to allow this traffic.
You can't have everything. Where would you put it?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 14936 times.
Similar Threads
Transferring file name then file data over socket
Sending a file over socket
Transfer multiple files from Server to Client using Sockets
File outputted has size zero
copying files over a network
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 19:20:46.