/// <summary> /// Closes the underlying <see cref="System.IO.Stream"/> of the current /// instance of <see cref="Kamilla.Network.Logging.NetworkLog"/>. /// </summary> public virtual void CloseStream() { if (m_stream != null) { m_stream.Close(); m_stream = null; } }
/// <summary> /// Initializes a new instance of ChatMessage, reading all the needed data from a byte array. /// </summary> /// <param name="data"> /// The byte array that contains all needed data for the ChatMessage. /// </param> /// <param name="opcode"> /// The opcode of a packet that contains the current message. /// /// Specify 0 opcode if you want basic parsing implementation. /// </param> public ServerChatMessage(byte[] data, WowOpcodes opcode) { StreamHandler Reader = new StreamHandler(data); ReadFromStreamHandler(Reader, opcode); Reader.Close(); }
internal void Close() { try { if (!Connected) { return; } Console.WriteLine("Handle Client closing..."); if (_sslStream != null) { _sslStream.Dispose(); } if (_http1Reader != null) { _http1Reader.Dispose(); } if (_http1Writer != null) { _http1Writer.Dispose(); } if (_sslReader != null) { _sslReader.Dispose(); } if (_sslWriter != null) { _sslWriter.Dispose(); } if (_streamHandler != null) { _streamHandler.Close(); } _streamHandler = null; hpackEncoder = null; _tcpClient.Close(); Connected = false; } catch (Exception) { throw; } }