Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Background: I have written a java server-client program. The server accepts incoming connections on port 2175 and writes responses on 2176 which the client listens on for the response. I am sending serialzed objects over the network.

Problem: This all works well if I run my client on the same machine as the server. I put together a client jar and deployed it on another machine running on the same wireless network as the server. Now I get a "ConnectionException :Connection refused". So I thought I should hardcode the server and client IP's but that still didnt work.

Question: What else would I have to do to get the two computers to talk to each other (in terms of networking not java)?

share|improve this question

migrated from stackoverflow.com Jul 6 '12 at 15:39

This question came from our site for professional and enthusiast programmers.

    
As you note yourself, you're not looking for a programming answer, so you're on the wrong site. (Note that there are no forums on the Stack Exchange network). –  Mat Apr 11 '12 at 7:15
add comment

3 Answers 3

up vote 1 down vote accepted

If you are getting a connection refused you are able to talk to the machine, its just not listening on that IP address. Try opening the service on all IP addresses (e.g. by not specifying one)

BTW: You only need one port for sending and receiving.

share|improve this answer
add comment

First step, make sure the client is actually attempting to connect to the server's address ( check your code, clean, recompile). Next step, check you can ping the server from the client. Next step, check any firewalls, especially on the server machine, making sure that it allows incoming connections on port 2175. If all those things seem OK, check your router isn't blocking the connection (although that would be a bit strange). Wireshark or some other packet sniffer can help you diagnose the problem further.

share|improve this answer
add comment

Seem to be in client system port is closed or blocked or used by any other application. It does not depend on wire or wireless network all depends on open ports and which normally handled by firewall policy.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.