SpaIot Library
Loading...
Searching...
No Matches
spaserver.h
1/*
2 SpaIot Library (c) by epsilonrt - epsilonrt@epsilonrt.fr
3 This file is part of SpaIot library <https://github.com/epsilonrt/spaiot-lib>
4
5 SPDX-License-Identifier: BSD-3-Clause
6
7 SpaIot library is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY;
9*/
10#pragma once
11
12#include "serversettings.h"
13#include "controlpanel.h"
14
15namespace SpaIot {
16 class SpaClient;
37 class SpaServer : public ControlPanel {
38 public:
43
52
56 int clientCount () const;
57
64 SpaClient *client (const String &className) const;
65
71 bool removeClient (const String &className);
72
78 bool removeClient (const char * className);
79
86
97 bool begin (const ServerSettings &settings, unsigned long waitingTimeMs = BeginWaitingTimeMs);
98
105 void end ();
106
113 bool handle ();
114
120 const ServerSettings *settings() const;
121
122 protected:
123 class Private;
124 SpaServer (Private &dd);
125 private:
126 PIMPL_DECLARE_PRIVATE (SpaServer)
127 };
128
129}
Control Panel.
Definition controlpanel.h:29
Server settings class.
Definition serversettings.h:24
SpaClient class.
Definition spaclient.h:48
SpaServer class.
Definition spaserver.h:37
const ServerSettings * settings() const
Returns the SpaServer Settings.
bool handle()
Process spa events and handle client requests.
bool begin(const ServerSettings &settings, unsigned long waitingTimeMs=BeginWaitingTimeMs)
Start the server.
int clientCount() const
Return the number of clients added to the server.
void end()
Stop the server.
SpaServer()
Default constructor.
SpaClient * client(const String &className) const
Return the client with the specified className.
bool removeClient(const char *className)
Remove a client from the server.
bool removeClient(const String &className)
Remove a client from the server.
bool addClient(SpaClient &client)
Add a client to the server.
bool removeClient(const SpaClient &client)
Remove a client from the server.
SpaIot name space.
Definition bussettings.h:15
const unsigned long BeginWaitingTimeMs
begin() waiting time in milliseconds
Definition global.h:85