EHS Embedded HTTP Server
1.5.1.0
|
Abstracts different socket types. More...
#include <networkabstraction.h>
Public Member Functions | |
virtual void | RegisterBindHelper (PrivilegedBindHelper *helper)=0 |
Registers a PrivilegedBindHelper for use by this instance. More... | |
virtual void | SetBindAddress (const char *bindAddress)=0 |
Sets the bind address of the socket. More... | |
virtual std::string | GetRemoteAddress () const =0 |
Retrieves the peer address. More... | |
virtual int | GetRemotePort () const =0 |
Retrieves the peer's port of a connection. More... | |
virtual std::string | GetLocalAddress () const =0 |
Retrieves the peer address. More... | |
virtual int | GetLocalPort () const =0 |
Retrieves the peer's port of a connection. More... | |
virtual std::string | GetAddress () const |
Retrieves the peer address. More... | |
virtual int | GetPort () const |
Retrieves the peer's port of a connection. More... | |
virtual std::string | GetPeer () const =0 |
Combination of GetRemoteAddress and GetRemotePort. More... | |
virtual void | Init (int port)=0 |
Initializes a listening socket. More... | |
virtual | ~NetworkAbstraction () |
Destructor. | |
virtual ehs_socket_t | GetFd () const =0 |
Retrieves the underlying file descriptor. More... | |
virtual int | Read (void *buf, int bufsize)=0 |
Performs a read from the underlying socket. More... | |
virtual int | Send (const void *buf, size_t buflen, int flags=0)=0 |
Performs a send on the underlying socket. More... | |
virtual void | Close ()=0 |
Closes the underlying socket. | |
virtual NetworkAbstraction * | Accept ()=0 |
Waits for an incoming connection. More... | |
virtual bool | IsSecure () const =0 |
Determines, whether the underlying socket is socure. More... | |
virtual void | ThreadCleanup ()=0 |
Handles thread specific clean up (used by OpenSSL). | |
Abstracts different socket types.
This interface abstracts the differences between normal sockets and SSL sockets. There are two implementations:
Definition at line 49 of file networkabstraction.h.
|
pure virtual |
Waits for an incoming connection.
A | std:runtime_error on failure. |
Implemented in Socket.
Referenced by ~NetworkAbstraction().
|
inlinevirtual |
Retrieves the peer address.
Definition at line 95 of file networkabstraction.h.
References GetRemoteAddress().
|
pure virtual |
Retrieves the underlying file descriptor.
Implemented in Socket.
Referenced by ~NetworkAbstraction().
|
pure virtual |
Retrieves the peer address.
Implemented in Socket.
|
pure virtual |
|
pure virtual |
|
inlinevirtual |
Retrieves the peer's port of a connection.
Definition at line 103 of file networkabstraction.h.
References GetPeer(), GetRemotePort(), and Init().
|
pure virtual |
Retrieves the peer address.
Implemented in Socket.
Referenced by GetAddress().
|
pure virtual |
|
pure virtual |
Initializes a listening socket.
If listening should be restricted to a specific address, SetBindAddress has to be called in advance.
port | The port to listen on. |
A | std:runtime_error if initialization fails. |
Implemented in Socket.
Referenced by GetPort().
|
pure virtual |
Determines, whether the underlying socket is socure.
Implemented in Socket.
Referenced by ~NetworkAbstraction().
|
pure virtual |
Performs a read from the underlying socket.
buf | Pointer to a buffer that receives the incoming data. |
bufsize | The maximum number of bytes to read. |
Implemented in Socket.
Referenced by ~NetworkAbstraction().
|
pure virtual |
Registers a PrivilegedBindHelper for use by this instance.
helper | The PrivilegedBindHelper to be used by this instance. |
Implemented in Socket.
|
pure virtual |
Performs a send on the underlying socket.
buf | Pointer to the data to be sent. |
buflen | The number of bytes to send. |
flags | Additional flags for the system call. |
Implemented in Socket.
Referenced by ~NetworkAbstraction().
|
pure virtual |
Sets the bind address of the socket.
bindAddress | The address to bind to in quad-dotted format. |
Implemented in Socket.