In many cases we write directly to the socket
outgoing buffer directly. The only way to flush
this buffer to the socket is to use send(),
which is artificial if we don't have any more
data to pass to send().
This makes it possible to safely call flush()
and, if there is buffered data, we flush it
to the socket.
Change-Id: I025e7ba5d1898e72dd0001547e104642608ab20a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>