Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Socket Won't Connect

Reply
Thread Tools

Socket Won't Connect

 
 
Chase Preuninger
Guest
Posts: n/a
 
      04-30-2008
Does anyone have any idea why when I create socket connections like
shown they only really work when I test them on my local machine or
when I test them on 2 computers on my wireless network. Other than
that I can't get a peer to peer connection to work.

Socket s = new Socket(Some InetAddress Object, Some Port);
 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      04-30-2008
Chase Preuninger wrote:
> Does anyone have any idea why when I create socket connections like
> shown they only really work when I test them on my local machine or
> when I test them on 2 computers on my wireless network. Other than
> that I can't get a peer to peer connection to work.
>
> Socket s = new Socket(Some InetAddress Object, Some Port);


Do you have a firewall in the way?

--

Knute Johnson
email s/nospam/linux/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDem
 
Reply With Quote
 
 
 
 
Nigel Wade
Guest
Posts: n/a
 
      04-30-2008
Chase Preuninger wrote:

> Does anyone have any idea why when I create socket connections like
> shown they only really work when I test them on my local machine or
> when I test them on 2 computers on my wireless network. Other than
> that I can't get a peer to peer connection to work.
>
> Socket s = new Socket(Some InetAddress Object, Some Port);


Given that you haven't told us either the IP address or the port in question,
then no, I don't know. All I can do is guess.

There are 3 things I can think of which might be getting in the way. There is no
route between the two IP addresses. The user running the code doesn't have
sufficient privilege to open the port requested. There is a firewall blocking
the connection.

--
Nigel Wade
 
Reply With Quote
 
Mark Space
Guest
Posts: n/a
 
      04-30-2008
Chase Preuninger wrote:
> Does anyone have any idea why when I create socket connections like
> shown they only really work when I test them on my local machine or
> when I test them on 2 computers on my wireless network. Other than
> that I can't get a peer to peer connection to work.
>
> Socket s = new Socket(Some InetAddress Object, Some Port);


Not enough info. Show us how you are actually calling this when if
fails. SSCCE please.



 
Reply With Quote
 
Chase Preuninger
Guest
Posts: n/a
 
      04-30-2008
If there was a firewall in the way wouldn't there be a messages that
pops up when I try to connect. Also what is a proxy?
 
Reply With Quote
 
RedGrittyBrick
Guest
Posts: n/a
 
      04-30-2008
Chase Preuninger wrote:
> If there was a firewall in the way wouldn't there be a messages that
> pops up when I try to connect.


Not necessarily. Most boundary firewalls don't send messages back to
clients. Your client program could pop-up a message if the connection fails.

> Also what is a proxy?


http://en.wikipedia.org/wiki/Proxy_server


--
RGB
 
Reply With Quote
 
Mark Space
Guest
Posts: n/a
 
      04-30-2008
Chase Preuninger wrote:
> If there was a firewall in the way wouldn't there be a messages that
> pops up when I try to connect. Also what is a proxy?


<http://en.wikipedia.org/wiki/Ping>
 
Reply With Quote
 
EJP
Guest
Posts: n/a
 
      04-30-2008
Chase Preuninger wrote:
> Does anyone have any idea why when I create socket connections like
> shown they only really work when I test them on my local machine or
> when I test them on 2 computers on my wireless network. Other than
> that I can't get a peer to peer connection to work.


As you haven't provided the exception message or the stack trace, no, I
have no idea.

The exception tells you *exactly* why:

ConnectException 'connection refused': somebody issued an RST, either
the target host, in which case nothing is listening at the port, or an
intermediate firewall, in which case you violated the firewall rules.

ConnectException 'connection timeout': most probably an intermediate
firewall is dropping you on the floor.

NoRouteToHostException: self-explanatory.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Steve Holden Python 1 02-03-2009 06:20 AM
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Steve Holden Python 0 02-01-2009 12:45 PM
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 0 02-01-2009 07:37 AM
socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 1 01-27-2009 05:05 PM
Re: socket.unbind or socket.unlisten? - socket.error: (48,'Address already in use') Jean-Paul Calderone Python 0 01-27-2009 01:41 PM



Advertisments