|
Ocean
|
This class is the base class for all server. More...
#include <Server.h>
Public Member Functions | |
| ~Server () override | |
| Destructs a server object. | |
| virtual bool | start () |
| Starts the server. | |
| virtual bool | stop () |
| Stops the server. | |
Public Member Functions inherited from Ocean::Network::Socket | |
| virtual | ~Socket () |
| Destructs a socket object. | |
| SocketId | id () const |
| Returns the socket id. | |
| Address4 | address () const |
| Returns the own address of this socket. | |
| Port | port () const |
| Returns the own port of this socket. | |
| virtual bool | setAddress (const Address4 &address) |
| Sets the own address of this socket. | |
| virtual bool | setPort (const Port &port) |
| Sets the own port of this socket. | |
| operator bool () const | |
| Returns whether this socket is valid. | |
Protected Member Functions | |
| Server () | |
| Creates a new server object. | |
Protected Member Functions inherited from Ocean::Network::Socket | |
| Socket () | |
| Creates a new socket object. | |
| Socket (const Socket &object)=delete | |
| Disabled copy constructor. | |
| bool | setBlockingMode (const bool blocking) |
| Sets the blocking mode of this socket. | |
| size_t | maximalMessageSize (const size_t defaultSize=65536) |
| Returns the maximal message size in bytes. | |
| bool | releaseSocket () |
| Releases the socket. | |
| virtual bool | onScheduler () |
| The scheduler event function. | |
| Socket & | operator= (const Socket &object)=delete |
| Disabled copy operator. | |
Protected Attributes | |
| Buffer | buffer_ |
| The socket buffer of this server. | |
| bool | schedulerIsActive_ = false |
| True, if the server scheduler is active. | |
Protected Attributes inherited from Ocean::Network::Socket | |
| SocketId | socketId_ = invalidSocketId() |
| Socket id. | |
| Lock | lock_ |
| Socket lock. | |
| NetworkResource | networkResource_ |
| The network resource object. | |
Additional Inherited Members | |
Public Types inherited from Ocean::Network::Socket | |
| enum | SocketResult { SR_SUCCEEDED = 0 , SR_FAILED , SR_BUSY , SR_NOT_CONNECTED } |
| Definition of individual result values. More... | |
| using | SocketId = SOCKET |
| Definition of a socket id. | |
| using | SocketId = int |
| Definition of a socket id. | |
| using | Buffer = std::vector< uint8_t > |
| Definition of a vector holding 8 bit values. | |
Static Public Member Functions inherited from Ocean::Network::Socket | |
| static constexpr SocketId | invalidSocketId () |
| Returns an invalid socket id. | |
| static bool | setBlockingMode (const SocketId socketId, const bool blocking) |
| Sets the blocking mode of a socket. | |
This class is the base class for all server.
|
override |
Destructs a server object.
|
protected |
Creates a new server object.
|
virtual |
Starts the server.
Beware: If a specific listening port is expected the own port has to be set before
Reimplemented in Ocean::Network::PackagedUDPServer, Ocean::Network::TCPServer, and Ocean::Network::UDPServer.
|
virtual |
Stops the server.
|
protected |
The socket buffer of this server.
|
protected |
True, if the server scheduler is active.