| 
    Ocean
    
   | 
 
This class implements a UDP server. More...
#include <UDPServer.h>
Public Member Functions | |
| UDPServer () | |
| Creates a new UDP server object.   | |
| ~UDPServer () override | |
| Destructs a UDP server object.   | |
| bool | start () override | 
| Starts the server.   | |
  Public Member Functions inherited from Ocean::Network::ConnectionlessServer | |
| ~ConnectionlessServer () override | |
| Destructs a connectionless server object.   | |
| void | setReceiveCallback (const ReceiveCallback &callback) | 
| Sets the receive data callback function.   | |
  Public Member Functions inherited from Ocean::Network::ConnectionlessClient | |
| SocketResult | send (const Address4 &address, const Port &port, const void *data, const size_t size) | 
| Sends data to a specified recipient.   | |
| SocketResult | send (const Address4 &address, const Port &port, const std::string &message) | 
| Sends a message to a specified recipient.   | |
  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.   | |
  Public Member Functions inherited from Ocean::Network::Server | |
| ~Server () override | |
| Destructs a server object.   | |
| virtual bool | stop () | 
| Stops the server.   | |
Protected Member Functions | |
| bool | buildSocket (const Address4 &localAddress=Address4(), const Port localPort=Port()) | 
| Creates a UDP server socket.   | |
  Protected Member Functions inherited from Ocean::Network::ConnectionlessServer | |
| ConnectionlessServer () | |
| Creates a new connectionless server object.   | |
| bool | onScheduler () override | 
| The scheduler event function.   | |
  Protected Member Functions inherited from Ocean::Network::ConnectionlessClient | |
| ConnectionlessClient () | |
| Creates a new connectionless client object.   | |
  Protected Member Functions inherited from Ocean::Network::Client | |
| Client () | |
| Creates a new client.   | |
| ~Client () override | |
| Destructs a client.   | |
  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.   | |
| Socket & | operator= (const Socket &object)=delete | 
| Disabled copy operator.   | |
  Protected Member Functions inherited from Ocean::Network::Server | |
| Server () | |
| Creates a new server object.   | |
Additional Inherited Members | |
  Public Types inherited from Ocean::Network::ConnectionlessServer | |
| using | ReceiveCallback = Callback< void, const Address4 &, const Port &, const void *, const size_t > | 
| Definition of a data callback function.   | |
  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.   | |
  Protected Attributes inherited from Ocean::Network::ConnectionlessServer | |
| ReceiveCallback | receiveCallback_ | 
| Data callback function called on new message arrivals.   | |
  Protected Attributes inherited from Ocean::Network::Client | |
| Buffer | socketBuffer_ | 
| The socket buffer of this client.   | |
  Protected Attributes inherited from Ocean::Network::Socket | |
| SocketId | socketId_ = invalidSocketId() | 
| Socket id.   | |
| Lock | lock_ | 
| Socket lock.   | |
| NetworkResource | networkResource_ | 
| The network resource object.   | |
  Protected Attributes inherited from Ocean::Network::Server | |
| Buffer | buffer_ | 
| The socket buffer of this server.   | |
| bool | schedulerIsActive_ = false | 
| True, if the server scheduler is active.   | |
This class implements a UDP server.
| Ocean::Network::UDPServer::UDPServer | ( | ) | 
Creates a new UDP server object.
      
  | 
  override | 
Destructs a UDP server object.
      
  | 
  protected | 
Creates a UDP server socket.
| localAddress | The local address to which the socket will be bound, a default address to bound the socket to any local address | 
| localPort | The local port to which the socket will be bound, a default port to bound the socket to any free port | 
      
  | 
  overridevirtual |