예제 #1
0
 /// <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();
     }
 }
예제 #2
0
 public SnmpMessenger()
 {
     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);
 }
예제 #3
0
 public SnmpMessenger(UdpClient existingClient)
 {
     this.CurrentRequestId = 0;
     SentLog                = new List <ProtocolDataUnit>();
     RecieveLog             = new List <ProtocolDataUnit>();
     this.CommunityName     = "public";
     this.SnmpVersion       = 1;
     SendRecieveTimeout     = 5000;
     this.MaxRetries        = 5;
     this.UdpTransport      = new UdpTransport(this, existingClient);
     this.TrasnportProtocol = ProtocolType.Udp;
     this.IPEndPoint        = (IPEndPoint)existingClient.Client.RemoteEndPoint;
 }