[Libwebsockets] Multiple http ports.

Roger Light roger at atchoo.org
Tue Aug 5 11:18:20 CEST 2014


On Wed, Jul 23, 2014 at 2:36 AM, Andy Green <andy at warmcat.com> wrote:
>
>
> On 23 July 2014 08:03:57 GMT+08:00, Steve Calfee <scalfee at mqidentity.com> wrote:

>>libwebsocket_callback_on_writable_all_protocol(&protocols[PROTOCOL_DUMB_INCREMENT])
>>
>>If I could do multiple ports what would the above call do?
>
> There is no problem because the protocols struct contains a pointer to the context that was
> set when the context was created.
>
> In turn though it means you can't share one protocols struct between multiple contexts, you
> need an individual struct protocols (perhaps memcpy'd from a template) for each context you create.

Given this is the case, how do we free the protocol structs when the
context is being destroyed?

Cheers,

Roger



More information about the Libwebsockets mailing list