flush after write to socket