0

I am currently building a WebSocket server and I came across the following code to handle fragmented messages (from libwebsockets):

case LWS_CALLBACK_RECEIVE:
{
    Client * const client = (Client *)user;
    const size_t remaining = libwebsockets_remaining_packet_payload(wsi);
    if (0 == remaining &&
        libwebsocket_is_final_fragment(wsi))
    {
        if (client->HasFragments())
        {
            client->AppendMessageFragment(in, len, 0);
            in = (void *)client->GetMessage();
            len = client->GetMessageLength();
        }

        client->ProcessMessage((char *)in, len, wsi);

        client->ResetMessage();
    }
    else
    {
        client->AppendMessageFragment(in, len, remaining);
    }
}
break;

My question is, what is the type Client? Which library/header should I add to my code?

Ronan Boiteau
  • 9,608
  • 6
  • 34
  • 56
Ronnie
  • 69
  • 1
  • 7

1 Answers1

0

You're looking at an outdated README in an outdated fork of the project. Go to the active project or visit the official page.

Myst
  • 18,516
  • 2
  • 45
  • 67