add LOGW
support TCP_BUFFERED

TCP_BUFFERED is useful when the app wants to reduce overhead of many small
packets but still have low latency provided by TCP_NODELAY. This is different
than TCP_NODELAY because it gives the app more control over when the packets
are flushed. Removed the sent parameter since buffered packets may not return
an error right away. Removed the option function in favor of the type
parameter for simplicity.

Note that when using TCP_BUFFERED a flush may be needed before receiving
data to ensure that the remote receives the packets for which it is
expected to respond.