|
DUECA/DUSIME
|
Common base type for websocket servers. More...
#include <WebSocketsServer.hxx>


Public Member Functions | |
| WebSocketsServerBase (Entity *e, const char *part, const PrioritySpec &ts, const char *classname, unsigned char marker) | |
| Constructor. | |
| template<typename S > | |
| bool | _complete_http (S &server) |
| Helper function, templated with the server type. | |
| virtual bool | complete () override |
| Complete the setup, needed for immediate start. | |
| virtual | ~WebSocketsServerBase () |
| Destructor. | |
| bool | setTimeSpec (const TimeSpec &ts) |
| Specify a time specification for the simulation activity. | |
| bool | checkTiming (const vector< int > &i) |
| Request check on the timing. | |
| bool | setCurrentData (const std::vector< std::string > &i) |
| Define a URL for reading latest data. | |
| bool | setFollowData (const std::vector< std::string > &i) |
| Define a URL for following all data in a channel entry. | |
| bool | setChannelInfo (const std::vector< std::string > &i) |
| Define a URL for tracking changes in a channel. | |
| bool | setWriterSetup (const std::vector< std::string > &i) |
| Define a URL for writing to a channel. | |
| bool | setPresetWriterSetup (const std::vector< std::string > &i) |
| Define a URL for writing to a channel. | |
| bool | setWriteReadSetup (const std::vector< std::string > &i) |
| Two-way communication set-up. | |
| bool | setCertFiles (const std::vector< std::string > &i) |
| Set SLL certificates; will convert to use SSL. | |
| bool | addMimeType (const std::vector< std::string > &i) |
| Add a mime type. | |
| bool | isPrepared () final |
| indicate that everything is ready. | |
| void | startModule (const TimeSpec &time) final |
| start responsiveness to input data. | |
| void | stopModule (const TimeSpec &time) final |
| stop responsiveness to input data. | |
| void | doTransfer (const TimeSpec &ts) |
| the method that implements the main calculation. | |
| void | doStart (const TimeSpec &ts) |
| Start-up activities, for when immediate start is requested. | |
| unsigned char | getMarker () const |
| sending marker, binary or string | |
| virtual void | codeData (std::ostream &s, const DCOReader &r) const =0 |
| Send data with, in a "tick"/"data" struct. | |
| virtual void | codeEmpty (std::ostream &s) const =0 |
| Code empty, no data. | |
| virtual void | codeEntryInfo (std::ostream &s, const std::string &w_dataname, unsigned w_entryid, const std::string &r_dataname, unsigned r_entryid) const =0 |
| Write type information to given stream. | |
Public Member Functions inherited from dueca::Module | |
| virtual | ~Module () |
| Destructor. | |
| virtual bool | isInitialPrepared () |
| To check whether the module is prepared to be prepared. | |
| ObjectType | getObjectType () const |
| The object type within DUECA. | |
| virtual void | initialStartModule (const TimeSpec &time) |
| Initial start opportunity. | |
| virtual void | finalStopModule (const TimeSpec &time) |
| Final stop command. | |
| const Entity * | getMyEntity () |
| Return a pointer to the entity to which this module belongs. | |
| const ModuleState & | getState () |
| Return the module state. | |
Public Member Functions inherited from dueca::NamedObject | |
| const std::string | getEntity () const |
| Returns the "entity" part of the name. | |
| const std::string | getClass () const |
| Returns the "class" part of the name. | |
| const std::string | getPart () const |
| Returns the sub-entity or "part" part of the name. | |
| const NameSet & | getNameSet () const |
| This returns the complete name set. | |
| const GlobalId & | getId () const |
| This returns the id. | |
Static Public Member Functions | |
| static const ParameterTable * | getMyParameterTable () |
| Return the parameter table. | |
Protected Attributes | |
| unsigned char | marker |
| Marker token for the websocket send calls. | |
| boost::scoped_ptr< WsServer > | server |
| Server, uncoded. | |
| boost::scoped_ptr< WssServer > | sserver |
| Server, coded. | |
| boost::scoped_ptr< HttpServer > | http_server |
| Http server, uncoded. | |
| boost::scoped_ptr< HttpsServer > | https_server |
| Http Server, coded. | |
| std::string | server_crt |
| Certificate for ssl use, if certificate and key are configured, the ssl version is used. | |
| std::string | server_key |
| Associated key. | |
| std::shared_ptr< boost::asio::io_context > | runcontext |
| IO context to perform a run. | |
| unsigned | port |
| Port to be used. | |
| unsigned | http_port |
| Port for http server. | |
| std::string | document_root |
| Folder with files for http server. | |
| std::map< std::string, std::string > | mimemap |
| Mime types map. | |
| bool | aggressive_reconnect |
| Flag to indicate aggressive reconnection to preset entries. | |
| bool | immediate_start |
| Immediate start, do not wait on DUECA's commands. | |
| bool | auto_started |
| Start flag for immediate_start. | |
| StateGuard | thelock |
| Access lock for shared data. | |
| PrioritySpec | read_prio |
| Priority for reading. | |
| TimeSpec | time_spec |
| Timing specification. | |
| bool | extended |
| If true, use the extended, non-official JSON specification. | |
| singleread_t | readsingles |
| Mapping connecting URL details to an object that reads a specific channel entry. | |
| singleread_t | autosingles |
| Mapping connecting URL details to an object that reads a specific channel entry. | |
| singlereadmap_t | singlereadsmapped |
| Mapping connection id to SingleEntryRead objects. | |
| followread_t | followers |
| Mapping connecting URL details to an object that reads and follows the data in a specific channel entry. | |
| followread_t | autofollowers |
| Mapping connecting URL details to an object that reads and follows the data in a specific channel entry. | |
| monitormap_t | monitors |
| map from URL to monitors | |
| writeables_t | writersetup |
| map from URL to writer setup | |
| presetwrites_t | presetwriters |
| map with preconfigured writeables; these have the channel token created | |
| writers_t | writers |
| map from connection pointers to the actual writers | |
| writereadables_t | writereadsetup |
| map from URL to write/read combination setup | |
| writersreaders_t | writersreaders |
| map with active write/read combinations | |
Protected Attributes inherited from dueca::Module | |
| ModuleState | state |
| Flag to remember whether we are stopped due to some error with hardware device manipulation. | |
Additional Inherited Members | |
Protected Member Functions inherited from dueca::Module | |
| Module (const Entity *e, const char *m_class, const char *part) | |
| Constructor. | |
| virtual void | setSafetyStop () |
| Put a brake on this module's activities. | |
Protected Member Functions inherited from dueca::NamedObject | |
| NamedObject (const GlobalId &id) | |
| Reserve for AssociateObject. | |
| NamedObject (const NameSet &ns) | |
| Normal constructor, protected, because it has no use to create a NamedObject by itself. | |
| virtual | ~NamedObject () |
| Destructor. | |
Common base type for websocket servers.
| dueca::websock::WebSocketsServerBase::WebSocketsServerBase | ( | Entity * | e, |
| const char * | part, | ||
| const PrioritySpec & | ts, | ||
| const char * | classname, | ||
| unsigned char | marker ) |
Constructor.
Is normally called from scheme/the creation script.
|
overridevirtual |
Complete the setup, needed for immediate start.
Reimplemented from dueca::Module.
Reimplemented in dueca::websock::WebSocketsServer< Encoder, Decoder >.
|
finalvirtual |
indicate that everything is ready.
Implements dueca::Module.
|
finalvirtual |
start responsiveness to input data.
Implements dueca::Module.
|
finalvirtual |
stop responsiveness to input data.
Implements dueca::Module.
|
pure virtual |
Send data with, in a "tick"/"data" struct.
Implemented in dueca::websock::WebSocketsServer< Encoder, Decoder >.
|
pure virtual |
Code empty, no data.
Implemented in dueca::websock::WebSocketsServer< Encoder, Decoder >.
|
pure virtual |
Write type information to given stream.
Implemented in dueca::websock::WebSocketsServer< Encoder, Decoder >.
|
protected |
Mapping connecting URL details to an object that reads a specific channel entry.
This is a map, indexed by Name+Entry, mapping URL basename + entry ID to SingleEntryRead objects with a read token. These are configured through the start script.
|
protected |
Mapping connecting URL details to an object that reads a specific channel entry.
Same type as the readsingles, however, created automatically from channel entries detected in one of the monitor locations, and only created when a client asks for access.
|
protected |
Mapping connection id to SingleEntryRead objects.
A mapping from connection ID/pointer to the SingleEntryRead objects in use by these connections. These objects are either common with the readsingles or autosingles maps.
|
protected |
Mapping connecting URL details to an object that reads and follows the data in a specific channel entry.
Maps url name and entry id to a SingleEntryFollow object. The SingleEntryFollow object has a list of connections as clients that will get new data from the followed entry as it comes in.
|
protected |
Mapping connecting URL details to an object that reads and follows the data in a specific channel entry.
Maps url name and entry id to a SingleEntryFollow object, created on the basis of a monitor. The SingleEntryFollow object has a list of connections as clients that will get new data from the followed entry as it comes in.