[Libwebsockets] How to get socket id from incoming request ?

Andy Green andy at warmcat.com
Sat Jun 11 23:33:46 CEST 2016



On June 11, 2016 11:20:08 PM GMT+08:00, Meir Yanovich <meiry242 at gmail.com> wrote:
>I don't want to hold the wsi pointer , i just want in this stage to

'Connection id' is a socket.io invention.  It doesn't exist as a concept in http, or ws, or lws.

>keep
>the connection id .
>what is the right way to do it ?

Why are you asking on the lws list about some socket.io-specific detail?

-Andy

>On Sat, Jun 11, 2016 at 4:52 PM, Andy Green <andy at warmcat.com> wrote:
>
>>
>>
>> On June 11, 2016 9:04:41 PM GMT+08:00, Meir Yanovich
><meiry242 at gmail.com>
>> wrote:
>> >Ops no its seams it's not .
>> >i tried to send ws request from 2 different sessions ( 2 browsers
>> >instances
>> >)
>> >and in both it gave me id == 0
>> >can it be the wsi created on each request ?
>>
>> The wsi will be unique for every active connection on that server. 
>But
>> take care as an integer, the minimum type to hold all the bits of a
>pointer
>> (the wsi is a pointer) is a long.
>>
>> -Andy
>>
>> >On Sat, Jun 11, 2016 at 3:31 PM, Meir Yanovich <meiry242 at gmail.com>
>> >wrote:
>> >
>> >> is it :
>> >> lws_get_protocol(wsi)->id
>> >> ?
>> >>
>> >> On Sat, Jun 11, 2016 at 3:25 PM, Meir Yanovich
><meiry242 at gmail.com>
>> >wrote:
>> >>
>> >>> Hello
>> >>> i try to port some socket.io code to libwebsockets ,
>> >>> in sockets,io there is something that called socket.id , which is
>> >some
>> >>> unique incoming connection id
>> >>> i wander what is the Equal in libwebsockets API .
>> >>> i want this unique id to be key in hashtable .
>> >>> thanks
>> >>>
>> >>>
>> >>
>> >
>> >
>>
>>------------------------------------------------------------------------
>> >
>> >_______________________________________________
>> >Libwebsockets mailing list
>> >Libwebsockets at ml.libwebsockets.org
>> >http://libwebsockets.org/mailman/listinfo/libwebsockets
>>
>>




More information about the Libwebsockets mailing list