208 void *ws_loop(void *threadid) |
208 void *ws_loop(void *threadid) |
209 { |
209 { |
210 struct lws_context_creation_info info; |
210 struct lws_context_creation_info info; |
211 int n = 0; |
211 int n = 0; |
212 |
212 |
213 syslog(LOG_NOTICE, "Thread ws_loop started"); |
|
214 |
|
215 memset(&info, 0, sizeof info); /* otherwise uninitialized garbage */ |
213 memset(&info, 0, sizeof info); /* otherwise uninitialized garbage */ |
216 info.port = 8010; |
214 info.port = Config.websocket_port; |
217 info.protocols = protocols; |
215 info.protocols = protocols; |
218 info.gid = -1; |
216 info.gid = -1; |
219 info.uid = -1; |
217 info.uid = -1; |
220 info.keepalive_timeout = 900; |
218 info.keepalive_timeout = 900; |
221 info.options = LWS_SERVER_OPTION_VALIDATE_UTF8; |
219 info.options = LWS_SERVER_OPTION_VALIDATE_UTF8; |
223 context = lws_create_context(&info); |
221 context = lws_create_context(&info); |
224 |
222 |
225 if (context == NULL) { |
223 if (context == NULL) { |
226 syslog(LOG_NOTICE, "libwebsocket_create_context() failed"); |
224 syslog(LOG_NOTICE, "libwebsocket_create_context() failed"); |
227 } |
225 } |
|
226 syslog(LOG_NOTICE, "Websocket server port %d started", info.port); |
228 |
227 |
229 /* |
228 /* |
230 * Loop forever until external shutdown variable is set. |
229 * Loop forever until external shutdown variable is set. |
231 */ |
230 */ |
232 while (n >= 0 && ! my_shutdown) { |
231 while (n >= 0 && ! my_shutdown) { |