aspose file tools
The moose likes Sockets and Internet Protocols and the fly likes what makes a socket close? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "what makes a socket close?" Watch "what makes a socket close?" New topic
Author

what makes a socket close?

Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 274
Hi,
Having some trouble with a socket closing unexpectedly in my app. Would a timeout while waiting for a recieve packet make a socket close and throw a socketException ? I keep getting socketException messages and I don't know if this is maybe simply a timeout or another problem that I don't know about.
Any info apprciated!
Kim
Ryan Langley
Ranch Hand

Joined: May 10, 2001
Posts: 46
Hello,
The socket will stay open until either the program exits or you call the close() method on the socket. This may be happening somewhere in your code, and you may not be realizing it. It can happen quite easily if you are using threads! Another problem could be that the socket port you are using may already be in use by the system. Make sure you are using a free port! Hope you find these suggestions helpful!
Cheers,
RL


Cheers,<P>RL
Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 274
Thanks RL! I appreciate your help very much. Will take a second look at things with that info.
Thanks!
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: what makes a socket close?
 
Similar Threads
A complex server
Socket Exception when closing Streams on a Socket
socket.accept() + socket.close()
interrupting a Socket.accept()
Client socket closing.