in reply to Re: Re: Disconnect client without closing socket?
in thread Disconnect client without closing socket?

According to perldoc IO::Socket, IO::Socket is derived from IO::Handle. IO::Handle provides a close() method.

--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';

Replies are listed 'Best First'.
Re: Re: Re: Re: Disconnect client without closing socket?
by Anonymous Monk on Dec 15, 2002 at 22:03 UTC
    The client isn't recognizing that the connection is closed. If I exit the server script, the client tells me that the connection is lost. How do I give the "Connection is lost." message without exitting the program?

      After forking, you have to close the client handle in the parent. You also need to close the listen socket in the child (unless you've set that handle to close on fork - I forget the system call that does this).

      --- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';
        $client->close; my $thread = threads->self->tid(); kill -9, $thread || die $!;
        This isn't doing it :/