Sockets and ClassLoader
I'm trying to connect multiple clients to a server using the same port. Each client is loaded by a different ClassLoader, but they are all calling the same code.
The first one connects just fine, every one after that I get a Connection Timed Out exception.
The place where it hangs is:
public static Socket createSocket()
throws IOException
{
return new Socket(server.ip.address, 7468);
}
Any suggestions on why the first one works and the rest fail?
[506 byte] By [
rwbrusha] at [2007-10-2 20:09:45]

No, the server just listens on that port.I'm thinking it has something to do with Spring since the app that is starting all these clients is being run with Spring through activemq and if I pull it out of all that it seems to work fine.
The server starts a thread that just accepts any connections then adds a listener to what comes in over the socket.
Thread t = new Thread(new Runnable() {
public void run() {
try {
for (;;) {
Socket s = serverSocket.accept();
acceptSocket(s);// Adds Listener
}
}
catch (IOException ioe) {
log("notifier thread: I/O exception: " + ioe, ioe);
}
catch (Throwable thr) {
log("notifier thread: internal error: " + thr, thr);
}
try {
serverSocket.close();
}
catch (IOException iox) {
}
}
});