thermferm/websocket.c

changeset 724
01e3936f62d4
parent 711
844588d0df65
child 730
6eba006ed8f5
equal deleted inserted replaced
723:99e3e6971f97 724:01e3936f62d4
444 444
445 void *my_ws_loop(void *threadid) 445 void *my_ws_loop(void *threadid)
446 { 446 {
447 struct lws_context_creation_info info; 447 struct lws_context_creation_info info;
448 int n = 0; 448 int n = 0;
449 pid_t pid = gettid();
449 450
450 my_ws_state = 1; 451 my_ws_state = 1;
451 memset(&info, 0, sizeof info); /* otherwise uninitialized garbage */ 452 memset(&info, 0, sizeof info); /* otherwise uninitialized garbage */
452 info.port = Config.websocket_port; 453 info.port = Config.websocket_port;
453 info.protocols = protocols; 454 info.protocols = protocols;
461 if (context == NULL) { 462 if (context == NULL) {
462 syslog(LOG_NOTICE, "libwebsocket_create_context() failed"); 463 syslog(LOG_NOTICE, "libwebsocket_create_context() failed");
463 my_ws_state = 0; 464 my_ws_state = 0;
464 return (void *)1; 465 return (void *)1;
465 } 466 }
466 syslog(LOG_NOTICE, "Websocket: server started port %d", info.port); 467 syslog(LOG_NOTICE, "Websocket: server started port %d, pid=%d", info.port, pid);
467 468
468 /* 469 /*
469 * Loop forever until external shutdown variable is set. 470 * Loop forever until external shutdown variable is set.
470 */ 471 */
471 while (n >= 0 && ! my_ws_shutdown) { 472 while (n >= 0 && ! my_ws_shutdown) {

mercurial