ImFusion C++ SDK 4.4.0
ImFusion::Network::ServerConnectionBase< Payload > Class Template Referenceabstract

#include <ImFusion/Stream/Network/ServerConnectionBase.h>

Abstract base class providing a server interface. More...

Inheritance diagram for ImFusion::Network::ServerConnectionBase< Payload >:

Detailed Description

template<typename Payload>
class ImFusion::Network::ServerConnectionBase< Payload >

Abstract base class providing a server interface.

This class implements functionality specific to servers, including listening for incoming connection requests and managing multiple client connections.

Implemented by WebsocketServer and TCPServer.

This class should only be used directly for implementing a custom server that will be registered with the ConnectionFactory.

Public Member Functions

virtual bool run ()=0
 Starts listening for incoming connections.
virtual bool stop ()=0
 Stops listening and terminates all open connections.
virtual bool isRunning () const =0
 Returns true if the server is actively listening for incoming connections.
virtual size_t connectedClients () const =0
 Returns the number of currently connected clients.
virtual std::string address () const =0
 Returns the address of the server in the form {ip}:{port} (e.g., 127.0.0.1:5678).
Public Member Functions inherited from ImFusion::Network::TypedConnectionBase< Payload >
virtual void sendMessage (Payload message)=0
 Sends a message over the network connection.

Public Attributes

ProtectedSignal< bool > signalClientConnected
 Signal emitted when a new client connects (true) or when a client disconnects (false).
Public Attributes inherited from ImFusion::Network::TypedConnectionBase< Payload >
ProtectedSignal< std::shared_ptr< const Payload > > signalNewMessage
 Signal emitted when a new message is received.
ProtectedSignal< std::shared_ptr< const Payload > > signalMessageSent
 Signal emitted when a message is sent.

Member Function Documentation

◆ run()

◆ stop()

◆ isRunning()

template<typename Payload>
virtual bool ImFusion::Network::ServerConnectionBase< Payload >::isRunning ( ) const
pure virtual

◆ connectedClients()

template<typename Payload>
virtual size_t ImFusion::Network::ServerConnectionBase< Payload >::connectedClients ( ) const
pure virtual

◆ address()

template<typename Payload>
virtual std::string ImFusion::Network::ServerConnectionBase< Payload >::address ( ) const
pure virtual

The documentation for this class was generated from the following file:
  • ImFusion/Stream/Network/ServerConnectionBase.h
Search Tab / S to search, Esc to close