Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple echo. Problem with connection to server.

 
Dawid Skrzypczynski
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I wrote simple echo service. It works perfectly when i am using localhost but problem is when i want to connect to my server using another machine which uses different IP address. Client program don't even want to connect. He is never asking for message so problem is with connection but i don't understand why. I checked ports using netstat command and they were an open. Can you help me ?

Server:


Client:
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That code shows you using the localhost for both client and server, which you say works fine. If you want help you need to show us the code that isn't working.
 
Dawid Skrzypczynski
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot change it in my example. I using the same code when i want to connect from another machine but off course in the server and client instead localhost i am using my ip address.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dawid Skrzypczynski wrote:I forgot change it in my example. I using the same code when i want to connect from another machine but off course in the server and client instead localhost i am using my ip address.

Right. But have you got the format of the IP address correct ? Probably you have, but if people here assume you have when you haven't then we are just wasting time looking for other possible causes. If you had posted the actual code you are using in the first place and the IP address format is correct, we could be already investigating those other reasons.
 
Dawid Skrzypczynski
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, this is complete code that i am using.


Server:


Client:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic