• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HELP : Connecting to machine in different network

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
On my planet I'm considered quite beautiful. Thanks to the poetry in this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic