|
phaser-server
0.0.7
|
Manage one connection session with a client. More...
#include <session.h>


Public Member Functions | |
| Session (cpplib::Connection, PhaseInterface &) | |
| Construct a Session object. More... | |
| void | NotifyClient (const std::string &) |
| Send a message to the client. More... | |
| bool | IsQuiet (void) const |
| Does this session not accept notifications? | |
| std::string | ClientInfo (void) const |
| Get information about the client associated with this session. More... | |
Static Public Member Functions | |
| static void | Manage (void) |
| Manage client sessions. More... | |
| static void | NotifyAllClients (const std::string &) |
| Send a message to all client sessions. More... | |
Manage one connection session with a client.
This thread class serves as a server client session. It manages one client connection, existing only while the connection remains open. Refer to thrlib::Thread documentation for information about object oriented threading and the cpplib::Server for C++ client/server communications.
| Session::Session | ( | cpplib::Connection | con, |
| PhaseInterface & | phaser | ||
| ) |
Construct a Session object.
Initialize a new instance and create its independent thread of execution.
| con | - The established client/server connection. |
| phaser | - Object that manages RF cavity phases. |
| std::string Session::ClientInfo | ( | void | ) | const |
Get information about the client associated with this session.
|
static |
Manage client sessions.
This static function simply listens for client connection requests. When a request is received, it creates a client session thread to handle all communications between the client and the server. This function only returns when it is time to exit the server.
|
static |
Send a message to all client sessions.
This uses the self serializing 'SessionList' for thread safe access to the list of client sessions.
| message | - The message to send. |
| void Session::NotifyClient | ( | const std::string & | message | ) |
Send a message to the client.
| message | - Message to be sent. |