#endif
}
+LWS_EXTERN void *
+libwebsocket_context_user(struct libwebsocket_context *context)
+{
+ return context->user_space;
+}
+
/**
* libwebsocket_service() - Service any pending websocket activity
* @context: Websocket context
struct libwebsocket_extension *extensions,
const char *ssl_cert_filepath,
const char *ssl_private_key_filepath,
- int gid, int uid, unsigned int options)
+ int gid, int uid, unsigned int options,
+ void *user)
{
int n;
int m;
context->fds_count = 0;
context->extensions = extensions;
context->last_timeout_check_s = 0;
+ context->user_space = user;
#ifdef WIN32
context->fd_random = 0;
struct libwebsocket_extension *extensions,
const char *ssl_cert_filepath,
const char *ssl_private_key_filepath, int gid, int uid,
- unsigned int options);
+ unsigned int options, void *user);
LWS_EXTERN void
libwebsocket_context_destroy(struct libwebsocket_context *context);
libwebsocket_service_fd(struct libwebsocket_context *context,
struct pollfd *pollfd);
+LWS_EXTERN void *
+libwebsocket_context_user(struct libwebsocket_context *context);
+
/*
* IMPORTANT NOTICE!
*
struct libwebsocket_protocols *protocols;
int count_protocols;
struct libwebsocket_extension *extensions;
+
+ void *user_space;
};
<i>const char *</i> <b>ssl_private_key_filepath</b>,
<i>int</i> <b>gid</b>,
<i>int</i> <b>uid</b>,
-<i>unsigned int</i> <b>options</b>)
+<i>unsigned int</i> <b>options</b>,
+<i>void *</i> <b>user</b>)
<h3>Arguments</h3>
<dl>
<dt><b>port</b>
context = libwebsocket_create_context(CONTEXT_PORT_NO_LISTEN, NULL,
protocols, libwebsocket_internal_extensions,
- NULL, NULL, -1, -1, 0);
+ NULL, NULL, -1, -1, 0, NULL);
if (context == NULL) {
fprintf(stderr, "Creating libwebsocket context failed\n");
return 1;
context = libwebsocket_create_context(server_port, interface, protocols,
libwebsocket_internal_extensions,
- cert_path, key_path, -1, -1, opts);
+ cert_path, key_path, -1, -1, opts, NULL);
if (context == NULL) {
fprintf(stderr, "libwebsocket init failed\n");
return -1;
context = libwebsocket_create_context(CONTEXT_PORT_NO_LISTEN, NULL,
protocols,
libwebsocket_internal_extensions,
- NULL, NULL, -1, -1, 0);
+ NULL, NULL, -1, -1, 0, NULL);
if (context == NULL) {
fprintf(stderr, "Creating libwebsocket context failed\n");
return 1;
context = libwebsocket_create_context(port, interface_ptr, protocols,
libwebsocket_internal_extensions,
- cert_path, key_path, -1, -1, opts);
+ cert_path, key_path, -1, -1, opts, NULL);
if (context == NULL) {
fprintf(stderr, "libwebsocket init failed\n");
return -1;
context = libwebsocket_create_context(port, interface, protocols,
libwebsocket_internal_extensions,
- cert_path, key_path, -1, -1, opts);
+ cert_path, key_path, -1, -1, opts, NULL);
if (context == NULL) {
fprintf(stderr, "libwebsocket init failed\n");
return -1;