7 #ifndef SOCKETSESSION_H
8 #define SOCKETSESSION_H 1
10 #include <boost/noncopyable.hpp>
16 #include <sys/socket.h>
179 virtual void close() = 0;
180 virtual void push(
int sock,
int family,
int type,
int protocol,
181 const struct sockaddr& local_end,
182 const struct sockaddr& remote_end,
183 const void* data,
size_t data_len) = 0;
264 virtual void close();
308 virtual void push(
int sock,
int family,
int type,
int protocol,
309 const struct sockaddr& local_end,
310 const struct sockaddr& remote_end,
311 const void* data,
size_t data_len);
359 const sockaddr* local_end,
const sockaddr* remote_end,
360 const void* data,
size_t data_len);
385 const void*
getData()
const {
return (data_); }
397 const sockaddr* local_end_;
398 const sockaddr* remote_end_;
399 const void*
const data_;
400 const size_t data_len_;
491 #endif // SOCKETSESSION_H
const sockaddr & getRemoteEndpoint() const
Return the remote end point of the session in the form of sockaddr.
int getProtocol() const
Return the transport protocol (such as IPPROTO_UDP) of the socket.
virtual void push(int sock, int family, int type, int protocol, const struct sockaddr &local_end, const struct sockaddr &remote_end, const void *data, size_t data_len)=0
virtual void push(int sock, int family, int type, int protocol, const struct sockaddr &local_end, const struct sockaddr &remote_end, const void *data, size_t data_len)
Forward a socket session to the receiver.
virtual ~SocketSessionForwarder()
The destructor.
SocketSession(int sock, int family, int type, int protocol, const sockaddr *local_end, const sockaddr *remote_end, const void *data, size_t data_len)
The constructor.
SocketSessionError(const char *file, size_t line, const char *what)
An exception indicating general errors that takes place in the socket session related class objects...
The "base" class of SocketSessionForwarder.
int getFamily() const
Return the address family (such as AF_INET6) of the socket.
The forwarder of socket sessions.
size_t getDataLength() const
Return the size of the session data in bytes.
virtual ~BaseSocketSessionForwarder()
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
SocketSessionForwarder(const std::string &unix_file)
The constructor.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
const sockaddr & getLocalEndpoint() const
Return the local end point of the session in the form of sockaddr.
The receiver of socket sessions.
int getSocket() const
Return the socket file descriptor.
SocketSession pop()
Receive a socket session from the forwarder.
~SocketSessionReceiver()
The destructor.
BaseSocketSessionForwarder()
int getType() const
Return the socket type (such as SOCK_DGRAM) of the socket.
virtual void connectToReceiver()=0
virtual void connectToReceiver()
Establish a connection to the receiver.
SocketSessionReceiver(int fd)
The constructor.
const void * getData() const
Return a pointer to the beginning of the memory region for the session data.
virtual void close()
Close the connection to the receiver.