MythTV  master
Public Member Functions | Protected Slots | Protected Attributes | List of all members
WebSocketServer Class Reference

The WebSocket server, which listens for connections. More...

#include <websocket.h>

Inheritance diagram for WebSocketServer:
Inheritance graph
[legend]
Collaboration diagram for WebSocketServer:
Collaboration graph
[legend]

Public Member Functions

 WebSocketServer ()
 
virtual ~WebSocketServer ()
 
bool IsRunning (void) const
 
- Public Member Functions inherited from ServerPool
 ServerPool (QObject *parent=nullptr)
 
 ~ServerPool (void)
 
bool listen (QList< QHostAddress > addrs, quint16 port, bool requireall=true, PoolServerType type=kTCPServer)
 
bool listen (QStringList addrs, quint16 port, bool requireall=true, PoolServerType type=kTCPServer)
 
bool listen (quint16 port, bool requireall=true, PoolServerType type=kTCPServer)
 
bool bind (QList< QHostAddress > addrs, quint16 port, bool requireall=true)
 
bool bind (QStringList addrs, quint16 port, bool requireall=true)
 
bool bind (quint16 port, bool requireall=true)
 
qint64 writeDatagram (const char *data, qint64 size, const QHostAddress &addr, quint16 port)
 
qint64 writeDatagram (const QByteArray &datagram, const QHostAddress &addr, quint16 port)
 
bool isListening (void)
 
int maxPendingConnections (void)
 
void setMaxPendingConnections (int n)
 
quint16 serverPort (void)
 
QNetworkProxy proxy (void)
 
void setProxy (const QNetworkProxy &proxy)
 
void close (void)
 
int tryListeningPort (int baseport, int range=1)
 tryListeningPort More...
 
int tryBindingPort (int baseport, int range=1)
 tryBindingPort More...
 

Protected Slots

void newTcpConnection (qt_socket_fd_t socket) override
 
- Protected Slots inherited from ServerPool
virtual void newUdpDatagram (void)
 
virtual void newTcpConnection (qt_socket_fd_t socket)
 

Protected Attributes

QReadWriteLock m_rwlock
 
MThreadPool m_threadPool
 
bool m_running {true}
 
QSslConfiguration m_sslConfig
 

Additional Inherited Members

- Signals inherited from ServerPool
void newConnection (QTcpSocket *)
 
void newDatagram (QByteArray, QHostAddress, quint16)
 
- Static Public Member Functions inherited from ServerPool
static void RefreshDefaultListen (void)
 
static QList< QHostAddress > DefaultListen (void)
 
static QList< QHostAddress > DefaultListenIPv4 (void)
 
static QList< QHostAddress > DefaultListenIPv6 (void)
 
static QList< QHostAddress > DefaultBroadcast (void)
 
static QList< QHostAddress > DefaultBroadcastIPv4 (void)
 
static QList< QHostAddress > DefaultBroadcastIPv6 (void)
 
static int tryListeningPort (QTcpServer *server, int baseport, int range=1, bool *isipv6=nullptr)
 tryListeningPort More...
 
static int tryBindingPort (QUdpSocket *socket, int baseport, int range=1, bool *isipv6=nullptr)
 tryBindingPort More...
 

Detailed Description

The WebSocket server, which listens for connections.

When WebSocketServer receives a connection it hands it off to a new instance of WebSocketWorker which runs it it's own thread, WebSocketWorkerThread

Definition at line 37 of file websocket.h.

Constructor & Destructor Documentation

◆ WebSocketServer()

WebSocketServer::WebSocketServer ( )

Definition at line 24 of file websocket.cpp.

◆ ~WebSocketServer()

WebSocketServer::~WebSocketServer ( )
virtual

Definition at line 39 of file websocket.cpp.

Member Function Documentation

◆ IsRunning()

bool WebSocketServer::IsRunning ( void  ) const
inline

Definition at line 45 of file websocket.h.

Referenced by WebSocketWorker::CleanupSocket(), and WebSocketWorker::doRead().

◆ newTcpConnection

void WebSocketServer::newTcpConnection ( qt_socket_fd_t  socket)
overrideprotectedslot

Definition at line 48 of file websocket.cpp.

Member Data Documentation

◆ m_rwlock

QReadWriteLock WebSocketServer::m_rwlock
mutableprotected

Definition at line 57 of file websocket.h.

Referenced by ~WebSocketServer().

◆ m_threadPool

MThreadPool WebSocketServer::m_threadPool
protected

Definition at line 58 of file websocket.h.

Referenced by newTcpConnection(), WebSocketServer(), and ~WebSocketServer().

◆ m_running

bool WebSocketServer::m_running {true}
protected

Definition at line 59 of file websocket.h.

Referenced by ~WebSocketServer().

◆ m_sslConfig

QSslConfiguration WebSocketServer::m_sslConfig
protected

Definition at line 62 of file websocket.h.

Referenced by newTcpConnection().


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