Dangerous SNMP
|
This is the base class of both the UDP and TCP transports. More...
#include <basicsockettransport.hpp>
Public Member Functions | |
BasicSocketTransport (std::weak_ptr< Context::PrivateData > context) | |
virtual bool | isConnected () |
This returns whether or not the transport is connected. More... | |
virtual void | connect () |
This instructs the transport to connect to its endpoint. More... | |
virtual void | disconnect () |
This shuts down the transport (if it was already connected). More... | |
bool | send (const std::vector< char > &bytes) |
std::vector< char > | receive (const std::chrono::milliseconds &timeout) |
![]() | |
unsigned int | maximumIncomingMessageSize () |
unsigned int | maximumOutgoingMessageSize () |
void | commitWrite () |
Protected Member Functions | |
virtual int | socketOptions () const |
When creating a socket, this is called to set the options that should be passed to the call. More... | |
virtual int | protocolNumber () const |
When creating a socket, this is called to set the protocol that should be passed to the call. More... | |
![]() | |
Transport (std::weak_ptr< Context::PrivateData > context) | |
void | registerReadWriteStreams (int readHandle, int writeHandle) |
void | unregisterReadWriteStreams (int readHandle, int writeHandle) |
Protected Attributes | |
int | socketHandle |
This is the socket handle. | |
std::string | address |
This is the address to which to connect. More... | |
std::string | port |
This is the port on which to connect. More... | |
![]() | |
unsigned int | _maximumIncomingMessageSize |
unsigned int | _maximumOutgoingMessageSize |
std::weak_ptr < Context::PrivateData > | context |
Additional Inherited Members | |
![]() | |
std::shared_ptr< ByteStream > | readerStream |
std::shared_ptr< ByteStream > | writerStream |
This is the base class of both the UDP and TCP transports.
Because the Berkeley socket API is implemented in such a way as to make any transports that use it almost identical, this class serves to handle all of major work, with the subclasses handling any specifics (such as the protocol number or "socket" options).
|
virtual |
This instructs the transport to connect to its endpoint.
This may or may not succeed; to check for success, call "isConnected" afterward.
Reimplemented from Transport.
|
virtual |
This shuts down the transport (if it was already connected).
If the transport was not connected, then this does nothing.
Reimplemented from Transport.
|
virtual |
This returns whether or not the transport is connected.
Reimplemented from Transport.
|
protectedvirtual |
|
protectedvirtual |
|
protected |
This is the address to which to connect.
This may be any string, including an IPv4 address, IPv6 address, a DNS name, etc.
|
protected |
This is the port on which to connect.
This may be any string, including a port number as well as the named "service" (if the system can translate it).