Dangerous SNMP
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
basicsockettransport.hpp
1 #pragma once
2 
3 #include "transport.hpp"
4 
5 
6 namespace dangerous { namespace snmp { namespace transport {
7 
17 public:
18  BasicSocketTransport( std::weak_ptr<Context::PrivateData> context );
19  virtual ~BasicSocketTransport();
20 
25  virtual bool isConnected();
26 
32  virtual void connect();
33 
38  virtual void disconnect();
39 
40 public:
41  bool send( const std::vector<char>& bytes );
42  std::vector<char> receive( const std::chrono::milliseconds& timeout );
43 
44 protected:
51  virtual int socketOptions() const;
52 
59  virtual int protocolNumber() const;
60 
61 protected:
64 
68  std::string address;
72  std::string port;
73 };
74 
75 } } }
76 
std::string port
This is the port on which to connect.
Definition: basicsockettransport.hpp:72
virtual int protocolNumber() const
When creating a socket, this is called to set the protocol that should be passed to the call...
virtual void connect()
This instructs the transport to connect to its endpoint.
virtual bool isConnected()
This returns whether or not the transport is connected.
The Transport class represents an abstraction of the transport mechanism behind SNMP.
Definition: transport.hpp:24
virtual void disconnect()
This shuts down the transport (if it was already connected).
virtual int socketOptions() const
When creating a socket, this is called to set the options that should be passed to the call...
This is the base class of both the UDP and TCP transports.
Definition: basicsockettransport.hpp:16
int socketHandle
This is the socket handle.
Definition: basicsockettransport.hpp:63
std::string address
This is the address to which to connect.
Definition: basicsockettransport.hpp:68