Re: How to detect if the other end of the TCP connection has gone offline
- From: jeffpyh@xxxxxxxxx (Jeff Pang)
- Date: Mon, 31 Oct 2005 23:07:24 +0800
On client side, you can write:
$sock->shutdown(1);
to send an EOF to remote server.
When the server receive the EOF,it will end of writing socket to
client,and send back an EOF to client.At this point,the socket talks
between client and server have finished.
2005/10/31, Karjala <karjala_lists@xxxxxxxxxxx>:
> I'm writing a simple client-server application, and I'm trying to find a
> way to tell if the other end of an open TCP connection has gone offline.
>
> I heard that with C you can send a packet of data and check if an ACK
> packet comes back. If it doesn't then the connection is closed. But how
> can that be done with Perl?
>
> I'm using the "IO::Socket" library, but if "Socket" can do it, I'm
> willing to revert to that.
>
> Thanks for your time,
> - Karj.
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx
> For additional commands, e-mail: beginners-help@xxxxxxxx
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>
.
- References:
- Prev by Date: Re: How to change the Owner of a file
- Next by Date: Re: How to detect if the other end of the TCP connection has gone offline
- Previous by thread: How to detect if the other end of the TCP connection has gone offline
- Next by thread: Re: How to detect if the other end of the TCP connection has gone offline
- Index(es):
Relevant Pages
|