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 / October 2006

Tip: Looking for answers? Try searching our database.

Dropped Sockets?

Thread view: 
Joshua Jung - 12 Oct 2006 21:19 GMT
Hi, I've built a client-server program that is designed to test server
load on a brand new Mac Pro machine of ours.

There are two programs: a server and a client generator. The server sits
idly waiting for connections (done in SSL), and the client just generates
a ton of clients at evenly spaced intervals (like every 100 milliseconds
or so).

For some reason, on the Mac machine, I get random "SocketConnection:
Socket Closed" errors when I try to do write operations. I can not trace
down any rhyme or reason as to why this is happening and nearly went crazy
trying to debug my code... and then I tried the same code on my Dell
Laptop running Ubuntu... worked like a charm!

Why would I be losing sockets like this?

Josh <><
Tom Forsmo - 12 Oct 2006 22:25 GMT
> Hi, I've built a client-server program that is designed to test server
> load on a brand new Mac Pro machine of ours.
[quoted text clipped - 11 lines]
>
> Why would I be losing sockets like this?

The first thought that comes to mind is differing socket implementations
on mac and linux, the same goes for the jvm. You should try to isolate
what causes the problem.

First you should try to figure out if its an os problem or a
jvm/language problem.

- can you create a similar program on the mac in a different language,
preferably one using the kernel api directly, such as c/c++. If the
problem persists its an os problem, if not, its a jvm problem.
- is there a different jvm you could try on the mac. if the problem
persists it its probably a language problem (such as a bad
design/implementation decision or perhaps a faulty jvm conformance test.).

You could also try to reduce the number of running clients/open sockets
on the mac, to see if the problem persists. An that way try to find a
way around the problem

tom
Joshua Jung - 12 Oct 2006 23:02 GMT
Any hints would be appreciated at this point!

Sometimes the very first connection is dropped... sometimes no connections
are dropped and sometimes all of them work. It is entirely random!

I have also done a look at netstat on the Mac OS X machine after running
the test once with only 10 clients... where 1 of the clients bombed after
trying to do a write() operation and gave a

SocketException: Socket closed

Error. Netstat did indeed show that only 9 of the connections existed (and
they were all healthy, as well).

It just seems so unusual...

Josh <><
none - 13 Oct 2006 01:08 GMT
> Any hints would be appreciated at this point!
>
[quoted text clipped - 13 lines]
>
> Josh <><
what is the network topology? are there firewalls between/on the
machines? any hardware routers that could be dodgy? if possible try
removing them temporarily. perhaps by connecting the two machines by a
crossover cable. Can you run a ping test from one machine to the other
during application use and see if there are any issues?

Tim
Joshua Jung - 17 Oct 2006 17:58 GMT
Ok, here's some more info:

No firewalls whatsoever.

The problem is the client generator... ONLY when it runs on Mac OS X.

Could this be a problem with the way Mac OS X implements SSL?

This doesn't make ANY sense to me now... I'm trying to rip apart my code
and debug things to see where the problem is occurring, but I'm having
quite a time doing it. The error(s) (socket closed, broken pipe etc.)
always occur on the server app (regardless of the type of machine) and the
client doesn't EVER report an error... so I had assumed it was the server
code, but apparently it's not... since the errors only show up on the
server when the client is run on Mac OS X.

Can you read too quickly from a socket after an SSL connection?

Need any help!

Josh <><
Tom Forsmo - 17 Oct 2006 22:03 GMT
> Ok, here's some more info:
>
[quoted text clipped - 13 lines]
>
> Can you read too quickly from a socket after an SSL connection?

Does other java code, f.ex. created by another person/project, using ssl
work as expected, if so then the problem is your code, perhaps a
portability problem. If not it might be the ssl library or as I stated
earlier, the jvm.

If is your code that is the problem, you need to provide more details
about the code f.ex. some code samples with error messages etc. Or you
could pick up a book, or something, that you can use to help verify the
code.

tom


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



©2008 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.