public Transmit ( int channelNumber, |
||
channelNumber | int | |
connection | ||
Résultat | void |
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); } }
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)); }
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); } }