Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

A strange error with Sockets

Thread view: 
pieterblomme - 24 Dec 2005 09:45 GMT
Hi,
I was having some problems with sockets, so I did some research to what
could cause the error.  I have found what caused it, but I'm affraid I
don't have a single clue of how to solve it.

I created a ServerSocket on the first comp, listening to port 5000.  No
problems occurred, the ServerSocket was succesfully created.
Then, I created a Socket on the second comp, who connected to that host
on port 5000.
Several minutes later, the connection timed out without having made a
succesfull connection.
All this was done using native Java.net API code, and since that has
been tested, the error can't have been caused by the code.

What could possibly cause this problem?
I did this test on a local network consisting out of a router, a Gentoo
computer and a Windows laptop.  

pieter
Chris Uppal - 24 Dec 2005 12:12 GMT
> I was having some problems with sockets, so I did some research to what
> could cause the error.  I have found what caused it, but I'm affraid I
> don't have a single clue of how to solve it.

Get yourself a copy of Ethereal (free at http://www.ethereal.com/) -- you are
just wasting your own time if you attempt any kind of network trouble-shooting
without it (or an equivalent).

   -- chris
Steve Horsley - 25 Dec 2005 18:45 GMT
>> I was having some problems with sockets, so I did some research to what
>> could cause the error.  I have found what caused it, but I'm affraid I
[quoted text clipped - 5 lines]
>
>     -- chris

Chris is right - Ethereal will tell you exactly what's happening.
But two quick questions:
    Can one computer ping the other?
    Is either one running a firewall?

Steve
Gordon Beaton - 25 Dec 2005 19:23 GMT
> I created a ServerSocket on the first comp, listening to port 5000.
> No problems occurred, the ServerSocket was succesfully created.
[quoted text clipped - 8 lines]
> network consisting out of a router, a Gentoo computer and a Windows
> laptop.

One guess: Your server code did not accept() the connection.

Second guess: the second client has DNS or routing issues. Does the
connection fail when you specify a hostname, or even when you specify
an IP address for the host?

Post your server code. Post your routing tables. Try pinging between
the hosts using hostnames and using IP addresses.

/gordon

Signature

[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e

Joseph Dionne - 27 Dec 2005 18:38 GMT
> Hi,
> I was having some problems with sockets, so I did some research to what
[quoted text clipped - 15 lines]
>
> pieter

First, rule out a problem with your java code by testing on one system, either
the Gentoo or Windows laptop, i.e. start server in one window and client in
another on the same system.

Second, I'll assume you are using Windows XP, and I have found in you add your
"remote" system in your Windoze hosts file, located on
%SystemRoot%\system32\drivers\etc, will reduce the connect time, but is not
the cause of your connection failure.

If your java code works on both systems locally, i.e. server and client
running in one system, then insure your router is not blocking the port your
are using, and/or your firewall settings on either Windoze or Gentoo allow
access to the port 5000.

Joseph


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.