The problem is that a connection sitting at the greeting isn't receiving any
data. It is in the nature of TCP that it can't detect a lost connection
until you try to send it data.
There's a keepalive flag you can set on the socket (on most OS's), that will
cause it to periodically send probe packets to see if the socket is still
connected, though this can take over 2 hours to detect a disconnection (RFC
1122).
int x = 1;
if (setsockopt(desc, SOL_SOCKET, SO_KEEPALIVE,
(void *) &x, sizeof(x) ) < 0)
{
perror( "SO_KEEPALIVE" );
close(desc);
}
Well, some OS's, that 2 hours thing is configurable.
The other option is to add a timer to the descriptor like the one in
char_data, and disconnect when it gets too high.
--Palrich.
----- Original Message -----
From: "Sarix" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, December 17, 2003 2:33 AM
Subject: Timeout at greet screen
> I'm not big on socket coding, but is there a way I can set a shorter
timeout
> time on connections that just sit at the greet screen? I have a few users
> that for some reason each time they connect their client has to connect
> twice and one sits at the greet screen. And it would be nice if I could
have
> the mud disconnect those who just sit there.
>
>
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom