protected virtual void Dispose(bool disposing) { if (disposing) { _currentSession.Dispose(); _currentSession = null; } }
public async Task Connect(string host, int port) { var socket = new Socket(SocketType.Stream, ProtocolType.Tcp); await socket.ConnectAsync(host, port); var stream = new NetworkStream(socket, true); _currentSession = new SmppSession(stream, stream); }