sptk2 logo
SPTK Home Page
Public Member Functions | List of all members
sptk::TCPServerListener Class Reference

#include <TCPServerListener.h>

Inheritance diagram for sptk::TCPServerListener:
sptk::Thread

Public Member Functions

 TCPServerListener (TCPServer *server, uint16_t port)
 
void threadFunction () override
 
void terminate () override
 
void listen ()
 
uint16_t port () const
 
String error () const
 
void stop ()
 
- Public Member Functions inherited from sptk::Thread
 Thread (const String &name, const std::shared_ptr< ThreadManager > &threadManager=nullptr)
 
virtual ~Thread ()
 
virtual void run ()
 
bool running () const
 
virtual void threadFunction ()=0
 
virtual void terminate ()
 
virtual void onThreadExit ()
 
virtual bool terminated ()
 
virtual void join ()
 
Id id () const
 
const Stringname () const
 
virtual bool sleep_for (std::chrono::milliseconds interval)
 
virtual bool sleep_until (const DateTime &timestamp)
 

Additional Inherited Members

- Public Types inherited from sptk::Thread
using Id = std::thread::id
 

Detailed Description

Internal TCP server listener thread

Constructor & Destructor Documentation

◆ TCPServerListener()

sptk::TCPServerListener::TCPServerListener ( TCPServer server,
uint16_t  port 
)

Constructor

Parameters
serverCTCPServer*, TCP server created connection
portint, Listener port number

Member Function Documentation

◆ error()

String sptk::TCPServerListener::error ( ) const
inline

Returns latest socket error (if any)

◆ listen()

void sptk::TCPServerListener::listen ( )
inline

◆ port()

uint16_t sptk::TCPServerListener::port ( ) const
inline

Returns listener port number

References sptk::BaseSocket::host().

◆ stop()

void sptk::TCPServerListener::stop ( )

Stop running listener and join its thread

◆ terminate()

void sptk::TCPServerListener::terminate ( )
overridevirtual

Custom thread terminate method

Reimplemented from sptk::Thread.

◆ threadFunction()

void sptk::TCPServerListener::threadFunction ( )
overridevirtual

Thread function

Implements sptk::Thread.


The documentation for this class was generated from the following file:

Fri Oct 14 2022 09:58:46: SPTK 5.4.1