Report write as flushed only when socket is open.
Poll bufferedAmount only when socket is open.