This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to send socket connection with the server socket

 
Vinod Vijay
Ranch Hand
Posts: 150
Java Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have written server side socket and client side sockets. I have executed my server socket first and trying to run and connect with server by running client now. I can easily connect with my server on same machine but not through different machine on same office LAN.
I'm getting following error message:-
My client:-


My Server:-


Please suggest.
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure the remote machine is accepting connections on that port? Your java server running there might say "listening at x.x.x.x:x" but that is only java listening. It does not mean the Operating System will allow connections on that port.
 
Vinod Vijay
Ranch Hand
Posts: 150
Java Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim McGuire wrote:Are you sure the remote machine is accepting connections on that port? Your java server running there might say "listening at x.x.x.x:x" but that is only java listening. It does not mean the Operating System will allow connections on that port.


How can I know that my OS is allowing connection on this specific port? Please tell me the steps. I would be really happy if I run my program successfully as I'm newbie in socket programming.

Thanks in advance.
 
Tim Moores
Bartender
Posts: 2895
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's something you should talk about with the network admin; for example, there could be a firewall between the two machines.
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vinod Vijay wrote:

How can I know that my OS is allowing connection on this specific port? Please tell me the steps. I would be really happy if I run my program successfully as I'm newbie in socket programming.



I guess I would start by trying to ping that remote machine. Do you know the Ping command? We can't know your environment or if that remote machine allows pinging, but it is easy to try. If you have admin rights to the remote machine ( and like Tim Moores said you should talk with the network admin if you have one ) you should be able to change the firewall settings.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic