Torc  0.1
torcwebsocketpool.h
Go to the documentation of this file.
1 #ifndef TORCWEBSOCKETPOOL_H
2 #define TORCWEBSOCKETPOOL_H
3 
4 // Qt
5 #include <QObject>
6 #include <QMutex>
7 
8 // Torc
9 #include "torcwebsocketthread.h"
10 
11 #define MAX_SOCKET_THREADS 50 // this will exclude peer websockets
12 
13 class TorcWebSocketPool : public QObject
14 {
15  Q_OBJECT
16 
17  public:
20 
21  public slots:
22  void WebSocketClosed (void);
23  void IncomingConnection (qintptr SocketDescriptor, bool Secure);
24 
25  public:
26  void CloseSockets ();
28 
29  private:
30  QList<TorcWebSocketThread*> m_webSockets;
31  QMutex m_webSocketsLock;
32 };
33 
34 #endif // TORCWEBSOCKETPOOL_H
void IncomingConnection(qintptr SocketDescriptor, bool Secure)
Wraps a TorcQThread around a TorcWebsocket.
TorcWebSocketThread * TakeSocket(TorcWebSocketThread *Socket)