[Libwebsockets] [libwebsockets] Add some getters. (#56)

"Andy Green (林安廸)" andy at warmcat.com
Sat Feb 15 09:41:00 CET 2014


On 15/02/14 16:19, the mail apparently from MacGritsch included:
> I am using it for this code (follwoing):
>
> replied as possible answer of mailinglist-mail with subject
> "[Libwebsockets] Libwebsockets push from the server problem"
>
> |libwebsockets_set_onclose_callback(context, onclose_callback);
>
> while (true)
> {
>      if (_notificationsInQueue)
>      {
>          _notificationsInQueue = false;
>
>          for (int i = libwebsockets_get_fd_count(context) - 1; i >= 0; i--)
>          {
>              struct libwebsocket *tmpWsi = libwebsockets_get_wsi_at_index(context, i);
>              if (tmpWsi)
>              {
>                  if (libwebsockets_get_protocol(tmpWsi) == &protocols[0])
>                  {
>                      PushNotificationSessionInfo *sessionInfo = (PushNotificationSessionInfo *)libwebsockets_get_user_space(tmpWsi);
>                      if (sessionInfo && sessionInfo->sendPushNotification)
>                      {
>                          libwebsocket_callback_on_writable(context, tmpWsi);
>
>                          sessionInfo->sendPushNotification = false;
>                      }
>                  }
>              }
>          }
>      }
>
>      if (libwebsocket_service(context, 100) != 0)
>      {
>          lwsl_err("libwebsocket_service not 0!\n");
>
>          break;
>      }
> }
> |

How about this?

http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit/?id=e39e6ef926141a61dddc61e4bb1ff1a1330f9d9b

-Andy



>> Reply to this email directly or view it on GitHub
> <https://github.com/warmcat/libwebsockets/issues/56#issuecomment-35150135>.
>




More information about the Libwebsockets mailing list