shutdown


Description:

public bool shutdown (bool shutdown_read, bool shutdown_write) throws Error

Shut down part or all of a full-duplex connection.

If shutdown_read is true then the receiving side of the connection is shut down, and further reading is disallowed.

If shutdown_write is true then the sending side of the connection is shut down, and further writing is disallowed.

It is allowed for both shutdown_read and shutdown_write to be true.

One example where it is useful to shut down only one side of a connection is graceful disconnect for TCP connections where you close the sending side, then wait for the other side to close the connection, thus ensuring that the other side saw all sent data.

Parameters:

this

a Socket

shutdown_read

whether to shut down the read side

shutdown_write

whether to shut down the write side

Returns:

true on success, false on error