2019-06-19 17:23:32 -05:00
|
|
|
/*************************************************************************
|
|
|
|
PURPOSE: (Represent Websocket variable server connection.)
|
|
|
|
LIBRARY DEPENDENCIES:
|
2019-07-18 16:35:29 -05:00
|
|
|
( (../src/WSSession.o))
|
2019-06-19 17:23:32 -05:00
|
|
|
**************************************************************************/
|
|
|
|
#ifndef WSSESSION_HH
|
|
|
|
#define WSSESSION_HH
|
|
|
|
|
|
|
|
#include <vector>
|
2019-08-16 18:39:45 -05:00
|
|
|
#include <string>
|
2019-06-19 17:23:32 -05:00
|
|
|
#include <mongoose.h>
|
2019-07-18 16:35:29 -05:00
|
|
|
#include "WSSessionVariable.hh"
|
2019-06-19 17:23:32 -05:00
|
|
|
|
|
|
|
class WSsession {
|
2019-08-16 18:39:45 -05:00
|
|
|
public:
|
2019-08-16 20:16:27 -05:00
|
|
|
WSsession(struct mg_connection *nc);
|
|
|
|
|
|
|
|
void stageData(); /* -- virtual Base */
|
|
|
|
void sendMessage(); /* -- virtual Base */
|
|
|
|
int handleMessage (std::string); /* -- virtual Base */
|
|
|
|
|
|
|
|
void setTimeInterval(unsigned int milliseconds); /* -- VariableServerSession specific */
|
|
|
|
void addVariable(char* vname); /* -- VariableServerSession specific */
|
|
|
|
void stageVariableValues(); /* -- VariableServerSession specific */
|
|
|
|
void pause(); /* -- VariableServerSession specific */
|
|
|
|
void unpause(); /* -- VariableServerSession specific */
|
|
|
|
void clear(); /* -- VariableServerSession specific */
|
|
|
|
void exit(); /* -- VariableServerSession specific */
|
|
|
|
|
2019-08-16 18:39:45 -05:00
|
|
|
int emitError(const char* fmt, ... );
|
|
|
|
|
|
|
|
static int bad_ref_int ;
|
|
|
|
|
|
|
|
private:
|
|
|
|
WSsession() {}
|
2019-08-16 20:16:27 -05:00
|
|
|
|
|
|
|
struct mg_connection* connection; /* -- Base */
|
|
|
|
|
|
|
|
REF2* make_error_ref(const char* in_name); /* -- VariableServerSession specific */
|
|
|
|
double stageTime; /* -- VariableServerSession specific */
|
|
|
|
std::vector<WSsessionVariable*> sessionVariables; /* -- VariableServerSession specific */
|
|
|
|
bool cyclicSendEnabled; /* -- VariableServerSession specific */
|
|
|
|
long long nextTime; /* -- VariableServerSession specific */
|
|
|
|
long long intervalTimeTics; /* -- VariableServerSession specific */
|
2019-06-19 17:23:32 -05:00
|
|
|
};
|
|
|
|
#endif
|