2024-12-01 19:35:24 +00:00
|
|
|
//| Copyright: (C) 2020-2024 Kevin Larke <contact AT larke DOT org>
|
|
|
|
//| License: GNU GPL version 3.0 or above. See the accompanying LICENSE file.
|
2019-12-24 15:05:24 +00:00
|
|
|
#ifndef cwWebsockSvr_H
|
|
|
|
#define cwWebsockSvr_H
|
|
|
|
|
|
|
|
namespace cw {
|
|
|
|
|
|
|
|
namespace websockSrv
|
|
|
|
{
|
|
|
|
typedef handle<struct websockSrv_str> handle_t;
|
|
|
|
|
|
|
|
rc_t create(
|
|
|
|
handle_t& h,
|
|
|
|
websock::cbFunc_t cbFunc, // This callback is made from the thread identified by websockSrv::threadHandle().
|
|
|
|
void* cbArg,
|
|
|
|
const char* physRootDir,
|
|
|
|
const char* dfltHtmlPageFn,
|
|
|
|
int port,
|
|
|
|
const websock::protocol_t* protocolA,
|
|
|
|
unsigned protocolN,
|
2024-03-28 23:48:46 +00:00
|
|
|
unsigned websockTimeOutMs,
|
|
|
|
unsigned queueBlkCnt,
|
2024-09-12 21:18:42 +00:00
|
|
|
unsigned queueBlkByteCnt,
|
|
|
|
bool extraLogsFl );
|
2019-12-24 15:05:24 +00:00
|
|
|
|
|
|
|
rc_t destroy( handle_t& h );
|
|
|
|
|
2019-12-28 04:35:39 +00:00
|
|
|
thread::handle_t threadHandle( handle_t h );
|
2019-12-24 15:05:24 +00:00
|
|
|
websock::handle_t websockHandle( handle_t h );
|
|
|
|
|
|
|
|
// Start or unpause the server.
|
|
|
|
rc_t start( handle_t h );
|
|
|
|
|
|
|
|
// Put the server into a pause state.
|
|
|
|
rc_t pause( handle_t h );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-10-31 18:17:43 +00:00
|
|
|
rc_t websockSrvTest( const object_t* cfg );
|
2019-12-24 15:05:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|