private void TransmitPacket(SSH2TransmissionPacket packet) { _allowedDataSize -= packet.DataWriter.Length - SSH2TransmissionPacket.INITIAL_OFFSET; _connection.TransmitPacket(packet); }
private SSH2TransmissionPacket OpenPacket() { SSH2TransmissionPacket packet = _packet; if (packet == null) { packet = _packet = new SSH2TransmissionPacket(); } packet.Open(); return packet; }
internal DataFragment SynchronizedTransmitPacket(SSH2TransmissionPacket packet) { lock (_transmitSync) { DataFragment data = packet.Close(_tCipher, _tMAC, _tSequence++); return _packetReceiver.SendAndWaitResponse(data); } }
internal void TransmitPacket(SSH2TransmissionPacket packet) { lock (_transmitSync) { DataFragment data = packet.Close(_tCipher, _tMAC, _tSequence++); _stream.Write(data.Data, data.Offset, data.Length); } }
public KeyExchanger(SSH2Connection con, byte[] sessionID) { _connection = con; _param = con.Param; _cInfo = (SSH2ConnectionInfo)con.ConnectionInfo; _sessionID = sessionID; _status = Status.INITIAL; _packet = new SSH2TransmissionPacket(); }
private SSH2TransmissionPacket OpenPacket() { SSH2TransmissionPacket packet = _transmissionPacket ?? (_transmissionPacket = new SSH2TransmissionPacket()); packet.Open(); return packet; }