Transmit() public method

public Transmit ( int channelNumber, Connection connection ) : void
channelNumber int
connection System.Net.Connection
return void
コード例 #1
0
 public virtual void Transmit(Command cmd)
 {
     lock (_shutdownLock)
     {
         if (CloseReason != null)
         {
             if (!Connection.Protocol.CanSendWhileClosed(cmd))
             {
                 throw new AlreadyClosedException(CloseReason);
             }
         }
         // We transmit *inside* the lock to avoid interleaving
         // of frames within a channel.
         cmd.Transmit(ChannelNumber, Connection);
     }
 }
コード例 #2
0
 public virtual Task Transmit(Command cmd)
 {
     if (CloseReason != null)
     {
         lock (_shutdownLock)
         {
             if (CloseReason != null)
             {
                 if (!Connection.Protocol.CanSendWhileClosed(cmd))
                 {
                     throw new AlreadyClosedException(CloseReason);
                 }
             }
         }
     }
     // We used to transmit *inside* the lock to avoid interleaving
     // of frames within a channel.  But that is fixed in socket frame handler instead, so no need to lock.
     return(cmd.Transmit(ChannelNumber, Connection));
 }
コード例 #3
0
ファイル: SessionBase.cs プロジェクト: REALTOBIZ/mono
 public virtual void Transmit(Command cmd)
 {
     lock (m_shutdownLock)
     {
         if (m_closeReason != null)
         {
             if (!m_connection.Protocol.CanSendWhileClosed(cmd))
           	    throw new AlreadyClosedException(m_closeReason);
         }
         // We transmit *inside* the lock to avoid interleaving
         // of frames within a channel.
         cmd.Transmit(m_channelNumber, m_connection);
     }
 }