/// <summary> /// Closes the Transport Sockets and clears the session information /// </summary> public void Close() { try { ResetSession(); SentLog = null; RecieveLog = null; this.IPEndPoint = null; this.PmppEndPoint = null; this.TcpTransport.Close(); this.TcpTransport = null; this.UdpTransport.Close(); this.UdpTransport = null; } catch { throw; } finally { GC.SuppressFinalize(this); GC.Collect(); GC.WaitForPendingFinalizers(); } }
public MessengerSession() { this.CurrentRequestId = 0; SentLog = new List <ProtocolDataUnit>(); RecieveLog = new List <ProtocolDataUnit>(); this.CommunityName = "public"; this.SnmpVersion = 1; SendRecieveTimeout = 5000; this.MaxRetries = 5; this.TcpTransport = new TcpTransport(this); this.UdpTransport = new UdpTransport(this); }