PL::NetworkServer class
-
class NetworkServer : public PL::Server
Network server class.
Subclassed by PL::HttpServer, PL::MdnsServer, PL::TcpServer
Public Functions
-
inline NetworkServer()
Creates a network server.
-
virtual uint16_t GetPort() = 0
Gets listening port.
- Returns:
port
-
virtual esp_err_t SetPort(uint16_t port) = 0
Sets listening port.
- Parameters:
port – port
- Returns:
error code
-
virtual size_t GetMaxNumberOfClients() = 0
Gets the maximum number of server clients.
- Returns:
number of clients
-
virtual esp_err_t SetMaxNumberOfClients(size_t maxNumberOfClients) = 0
Sets the maximum number of server clients.
- Parameters:
maxNumberOfClients – number of clients
- Returns:
error code
-
virtual esp_err_t Enable() = 0
Enables the server.
- Returns:
error code
-
virtual esp_err_t Disable() = 0
Disables the server.
- Returns:
error code
-
virtual bool IsEnabled() = 0
Checks if the server is enabled.
- Returns:
true if the server is enabled
-
std::string GetName()
Gets the server name.
- Returns:
name
-
void SetName(const std::string &name)
Sets the server name.
- Parameters:
name – name
-
virtual esp_err_t Lock(TickType_t timeout = portMAX_DELAY) = 0
Locks the object.
- Parameters:
timeout – timeout in FreeRTOS ticks
- Returns:
error code
-
virtual esp_err_t Unlock() = 0
Unlocks the object.
- Returns:
error code
-
inline NetworkServer()