Brunet.Transport.TcpEdgeListener.SocketState.FlushSocket C# (CSharp) Method

FlushSocket() public method

public FlushSocket ( Socket s ) : void
s Socket
return void
      public void FlushSocket(Socket s) {
        //Let's try to flush the buffer:
        ReceiveState rs = (ReceiveState)_sock_to_rs[s];
        bool flushed = true;
        if( rs != null ) {
          lock( rs.Edge ) {
            flushed = rs.Edge.Flush();
          }
        }
        if( flushed ) {
          //This socket is flushed, forget it:
          _socks_to_send.Remove(s);
        }
        else {
          //Make sure we continue to check this for writability
          //This is a "set-like" operation, Add... is idempotent
          AddSendWaiter(s);
        }
      }