public virtual void Dispose() { if (IsDisposed) { return; } IsDisposed = true; if (Socket != default(Socket)) { PodeSocket.CloseSocket(Socket); } if (InputStream != default(Stream)) { InputStream.Dispose(); } if (BufferStream != default(MemoryStream)) { BufferStream.Dispose(); } PodeHelpers.WriteErrorMessage($"Request disposed", Context.Listener, PodeLoggingLevel.Verbose, Context); }
public virtual void Dispose() { if (Socket != default(Socket)) { PodeSocket.CloseSocket(Socket); } }
public void Add(PodeSocket socket) { // if this socket has a hostname, try to re-use an existing socket if (socket.HasHostnames) { var foundSocket = Sockets.FirstOrDefault(x => x.Equals(socket)); if (foundSocket != default(PodeSocket)) { foundSocket.Hostnames.AddRange(socket.Hostnames); socket.Dispose(); return; } } socket.BindListener(this); Sockets.Add(socket); }
public virtual void Dispose() { if (Socket != default(Socket)) { PodeSocket.CloseSocket(Socket); } if (InputStream != default(Stream)) { InputStream.Dispose(); } if (BufferStream != default(MemoryStream)) { BufferStream.Dispose(); } }