PREV UP NEXT C++ socket classes for OS/2

3.2: Destructor

sockbuf::~sockbuf() flushes output and closes its socket if no other sockbuf is referencing it and _S_DELETE_DONT_CLOSE flag is not set. It also deletes its read and write buffers.

In what follows,

sockbuf::~sockbuf()
flushes output and closes its socket if no other sockbuf object is referencing it before deleting its read and write buffers. If the _S_DELETE_DONT_CLOSE flag is set, then the socket is not closed.
s.close()
closes the socket even if it is referenced by other sockbuf objects and _S_DELETE_DONT_CLOSE flag is set.
s.shutdown(how)
shuts down read if how is sockbuf::shut_read, shuts down write if how is sockbuf::shut_write, and shuts down both read and write if how is sockbuf::shut_readwrite.