[Libwebsockets] Upgraded from 3.2 to v4.2.0 and getting an error

Dave Horton daveh at beachdognet.com
Tue Apr 20 04:38:06 CEST 2021

I have some ws client code that has been running on 3.2 for quite a while with no issues, when I tried to upgrade to v4.2.0 I am getting an error.  Specifically, my lws_service call is returning right away with an error.

I am wondering if there are any pointers on necessary changes when upgrading from 3.x to 4.x?

The logs I see when I start my process are:

lws_service_thread creating context in service thread 0.

LWS: 4.2.0-v4.2.0, loglevel 7
NET CLI SRV H1 H2 WS ConMon IPv6-absent
 ++ [wsi|0|pipe] (1)
 ++ [vh|0|netlink] (1)
ERROR: rops_pt_init_destroy_netlink: netlink bind failed. 
-- [vh|0|netlink] (0) 20μs
 ++ [vh|1|default||-1] (1)

lws_service_thread ending in service thread 0

And my code looks like this:

  memset(&info, 0, sizeof info); 
  info.port = CONTEXT_PORT_NO_LISTEN; 
  info.protocols = protocols;

  info.ka_time = 60;                    // tcp keep-alive timer
  info.ka_probes = 4;                   // number of times to try ka before closing connection
  info.ka_interval = 5;                 // time between ka's
  info.timeout_secs = 10;                // doc says timeout for "various processes involving network roundtrips"
  info.keepalive_timeout = 5;           // seconds to allow remote client to hold on to an idle HTTP/1.1 connection 
  info.timeout_secs_ah_idle = 10;       // secs to allow a client to hold an ah without using it

  lwsl_notice("AudioPipe::lws_service_thread creating context in service thread %d.\n", nServiceThread);

  contexts[nServiceThread] = lws_create_context(&info);
  if (!contexts[nServiceThread]) {
    lwsl_err("AudioPipe::lws_service_thread failed creating context in service thread %d..\n", nServiceThread); 
    return false;

  int n;
  do {
    n = lws_service(contexts[nServiceThread], 50);
  } while (n >= 0 && !lws_stopping);

  lwsl_notice("AudioPipe::lws_service_thread ending in service thread %d\n", nServiceThread); 
  return true;

Any thoughts on what might be the issue?


More information about the Libwebsockets mailing list