10 Nov, 2010, Zeno wrote in the 1st comment:
Votes: 0
I'm attempting to get an old game called Phantasia 4 running. The code is here: http://www.mudbytes.net/file-890 It's a C server with a Java client.

I had this running years back just fine. Now I've gone and tried getting this setup again. It compiles without issue. It runs just fine. The client runs just fine. So I start the server and have the client start like normal. It sits there for a minute or two then the client says: Error The socket connection timed out.

While the client is sitting there before the error, I check the connections on the server and I see the client connecting:
COMMAND     PID     USER   FD   TYPE    DEVICE SIZE NODE NAME
phantasia 17924 root 4u IPv4 242650391 TCP *:43302 (LISTEN)
phantasia 17924 root 5u IPv4 246045659 TCP biyg.org:43302->rrcs-24-97-153-1.nys.biz.rr.com:55631 (ESTABLISHED)

I've tried this on multiple servers and the client on multiple computers. The current one has no firewall, so I can't imagine it being a firewall issue.

Here are the logs of what happens:
Quote
Wed Nov 10 10:55:40 2010 [?:24.97.153.1:17924] Connection on socket 5.
Wed Nov 10 10:57:55 2010 [?:24.97.153.1:17924] Socket connection timed out.
Wed Nov 10 10:57:55 2010 [?:24.97.153.1:17924] Leaving the game after 135 seconds.

Quote
Wed Nov 10 10:55:40 2010 Connection, IP=24.97.153.1, Network=24.97.153.1.
Wed Nov 10 10:55:40 2010 Request mutex bfcb00a4 lock.
Wed Nov 10 10:55:40 2010 Mutex bfcb00a4 locked.
Wed Nov 10 10:55:40 2010 Mutex bfcb00a4 unlocked.
Wed Nov 10 10:55:40 2010 Request mutex bfcb00a4 lock.
Wed Nov 10 10:55:40 2010 Mutex bfcb00a4 locked.
Wed Nov 10 10:55:40 2010 Mutex bfcb00a4 unlocked.
Wed Nov 10 10:55:40 2010 [?:24.97.153.1:17924] Queued (2)
Wed Nov 10 10:55:40 2010 [?:24.97.153.1:17924] sending 2 bytes
Wed Nov 10 10:55:40 2010 [?:24.97.153.1:17924] (2
)
Wed Nov 10 10:55:40 2010 [?:24.97.153.1:17924] now sleeping with alarm set for 120 seconds.
Wed Nov 10 10:57:40 2010 [?:24.97.153.1:17924] awoken on signal 14.
Wed Nov 10 10:57:40 2010 [?:24.97.153.1:17924] Queued (4)
Wed Nov 10 10:57:40 2010 [?:24.97.153.1:17924] sending 2 bytes
Wed Nov 10 10:57:40 2010 [?:24.97.153.1:17924] (4
)
Wed Nov 10 10:57:40 2010 [?:24.97.153.1:17924] now sleeping with alarm set for 120 seconds.
Wed Nov 10 10:57:55 2010 [?:24.97.153.1:17924] awoken on signal 14.
Wed Nov 10 10:57:55 2010 [?:24.97.153.1:17924] Queued (8)
Wed Nov 10 10:57:55 2010 [?:24.97.153.1:17924] Queued (The socket connection timed out.)
Wed Nov 10 10:57:55 2010 [?:24.97.153.1:17924] sending 35 bytes
Wed Nov 10 10:57:55 2010 [?:24.97.153.1:17924] (8
The socket connection timed out.
)
Wed Nov 10 10:57:55 2010 Request mutex bfcb0074 lock.
Wed Nov 10 10:57:55 2010 Mutex bfcb0074 locked.
Wed Nov 10 10:57:55 2010 Mutex bfcb0074 unlocked.
Wed Nov 10 10:57:55 2010 Request mutex bfcb0134 lock.
Wed Nov 10 10:57:55 2010 Mutex bfcb0134 locked.
Wed Nov 10 10:57:55 2010 Mutex bfcb0134 unlocked.
Wed Nov 10 10:57:55 2010 Request mutex bfcb00a4 lock.
Wed Nov 10 10:57:55 2010 Mutex bfcb00a4 locked.
Wed Nov 10 10:57:55 2010 Mutex bfcb00a4 unlocked.
Wed Nov 10 10:57:55 2010 Request mutex bfcb00a4 lock.
Wed Nov 10 10:57:55 2010 Mutex bfcb00a4 locked.
Wed Nov 10 10:57:55 2010 Mutex bfcb00a4 unlocked.
Wed Nov 10 10:57:55 2010 Request mutex 9dda6b8 lock.
Wed Nov 10 10:57:55 2010 Mutex 9dda6b8 locked.
Wed Nov 10 10:57:55 2010 Mutex 9dda6b8 unlocked.
Wed Nov 10 10:57:55 2010 Request mutex bfcb00a4 lock.
Wed Nov 10 10:57:55 2010 Mutex bfcb00a4 locked.
Wed Nov 10 10:57:55 2010 Mutex bfcb00a4 unlocked.


Quote
Wed Nov 10 10:57:55 2010 [?:24.97.153.1:17924] Socket connection timed out in Do_get_socket_string.


Quote
Wed Nov 10 10:55:40 2010 New connection on socket 5.


Here's what it waits for found in socket.c:
/* prepare to unblock SIGIO */
sigemptyset(&sigMask);
sigaddset(&sigMask, SIGIO);
sigaddset(&sigMask, SIGALRM);

sigwait(&sigMask, &theSignal);


I assume it's waiting for the client to send something, but I can't really find anything in the client source. I see this:
public void run() {

int thePacket = 0;

for (;;) {

thePacket = (int) parent.readLong();
/*
System.out.println("Switching on packet " + thePacket);
*/
switch(thePacket) {

case HANDSHAKE_PACKET:
parent.sendString(C_RESPONSE_PACKET + clientVersion + "\0");

parent.sendString(C_RESPONSE_PACKET +
parent.getParameter("num") + "\0");

parent.sendString(C_RESPONSE_PACKET +
parent.getParameter("hash") + "\0");

parent.sendString(C_RESPONSE_PACKET +
parent.getParameter("time") + "\0");

break;


But I don't see anything wrong. And I know this source worked. My only thought is that a newer version of Java is doing something here like blocking connections that don't have a cert. Any thoughts?

You can try it yourself here: http://www.biyg.org/phantasia/
11 Nov, 2010, Zeno wrote in the 2nd comment:
Votes: 0
0.0/2