hi,
how to inform the server that is a client is interrupted, and close the socket?
Thanks!
hi,
how to inform the server that is a client is interrupted, and close the socket?
Thanks!
If the other end of a socket is closed, your end will be marked as readable and return 0
from read
- this is the "end of file" indication.
If you try to write
to such a socket, you will recieve the SIGPIPE
signal, and the write
will return error with errno set to EPIPE
("Broken Pipe"). You must be prepared to handle this event, because the other end can close the socket at any time.