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

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?
  • Comment on Re: Re: Re: Re: Disconnect client without closing socket?

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Disconnect client without closing socket?
by pfaut (Priest) on Dec 15, 2002 at 22:06 UTC

    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 :/
        That's a useless use of kill -9. "Don't use kill -9. Don't bring out the combine harvester just to tidy up the flower pot."

        Makeshifts last the longest.