Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HELP : Connecting to machine in different network

 
Sachin Joshi
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am facing a problem regarding connecting to machine in a different network. My application is using ServerSocket and Socket pair
for this communication. My ServerSocket is running on some machine in network A. My Client programs running on machines in
network B are trying to connect to the server programs. But I am getting
"java.net.ConnectException: Connection timed out: connect" exception on
"Socket sockClient = new Socket(p_strRemoteServerIp, p_iRemotePort);" this line.
1. There is no firewall between these 2 networks.
2. I can ping from machine in network B to machine in network A from command prompt.
3. My server machine running ServerSocket is having a only a single LAN Card i.e. having only 1 IP address.
Can anybody guide in this ?
Thanks,
Sachin
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
This exception is tipically thrown if no process is listening. Try running a telnet session against the server to see if it is listening where it ought to.
 
Sachin Joshi
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jose Botella:
Hello,
This exception is tipically thrown if no process is listening. Try running a telnet session against the server to see if it is listening where it ought to.

Hi john,
Thanks for the reply.
I tried that too. If I execute telnet command to the machine running the ServerSocket, it shows it is that it is listening.
Do suggest me if you find anything else.
Sachin
 
Sachin Joshi
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sachya Joshi:

Hi john,
Thanks for the reply.
I tried that too. If I execute telnet command to the machine running the ServerSocket, it shows it is that it is listening.
Do suggest me if you find anything else.
Sachin

Hi all,

Got my problem solved. Thanks John and others who you have put some time on it.
I just tried by changing the port number to 2000 and it worked. I still do not know why it was not working for initial port number 4444. :roll:

Sachin.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic