In the default case, upon
the network stack attempts to gracefully shutdown the connection after ensuring all data is sent but this occurs asynchronously
—in the background
—and the call to will return without guaranteeing that this shutdown has completed.
case is, of course, different. It has two modes of operation: When
is zero and when it is nonzero. When zero,
still returns immediately, but unsent data is discarded and (for connection-oriented protocols) the connection is reset (e.g., a RST is sent in the case of TCP). When nonzero, the
behaves synchronously and blocks until the time specified by
elapses, at which point the behavior is as in the zero
I can see plenty of design choices that would suggest you should or should not use
, but if that behavior is desirable for your application I would not classify them as "downsides."