[Libwebsockets] 答复: 回复: 答复: A question about libwebsockets dns resolve

huangkaicheng huangkaicheng at huawei.com
Thu May 21 03:22:27 CEST 2020


> If we want that, we need to move the individual connect timeouts lws manages to its own private lws_sul.
Can you help to move the individual connect timeouts lws manages to its own private lws_sul? Thanks.


-----邮件原件-----
发件人: huangkaicheng 
发送时间: 2020年5月20日 14:21
收件人: 'andy at warmcat.com' <andy at warmcat.com>; libwebsockets <libwebsockets at ml.libwebsockets.org>
抄送: Chenyake <chenyake at huawei.com>
主题: 回复: [Libwebsockets] 答复: A question about libwebsockets dns resolve

>"reuse" means I not only set the time, but direct it to use a different 
>callback when it fires... after the connect if you set a wsi timeout it will also set the callback to handle a generic wsi timeout.  So while it's waiting for connect, setting some other wsi timeout is in conflict with this connect timeout detection stuff.

I understand what you mean, But it seems that in  windows and linux it is different when I test.
>Why do you want to set an explicit wsi timeout on it when it already 
>now takes care of setting the connect timeout itself?  You're trying to set an overall timeout including all retries?  If we want that, we need to move the individual connect timeouts lws manages to its own private lws_sul.

Yes, we want to set an overall timeout including all retries. because all tries times is tool long, it is not good.

-----邮件原件-----
发件人: andy at warmcat.com [mailto:andy at warmcat.com]
发送时间: 2020年5月20日 11:37
收件人: huangkaicheng <huangkaicheng at huawei.com>; libwebsockets <libwebsockets at ml.libwebsockets.org>
抄送: Chenyake <chenyake at huawei.com>
主题: Re: 回复: [Libwebsockets] 答复: A question about libwebsockets dns resolve



On May 20, 2020 3:20:14 AM UTC, huangkaicheng <huangkaicheng at huawei.com> wrote:
>Hi,
>I know why because I set timeout
>"PENDING_TIMEOUT_AWATING_CONNECT_RESPONSE", if I set this time_out like
>20 sec. and "schedule wait_time" out will not take effect. If it is 
>confict with  "PENDING_TIMEOUT_AWATING_CONNECT_RESPONSE" in mac?, but 
>in windows and linux will not?

The way I implemented this connect timeout was to reuse the wsi lws_sul that tracks timeout

https://libwebsockets.org/git/libwebsockets/commit?id=918a608552bfe5002196715a6d6b3793bfc29f74

"reuse" means I not only set the time, but direct it to use a different callback when it fires... after the connect if you set a wsi timeout it will also set the callback to handle a generic wsi timeout.  So while it's waiting for connect, setting some other wsi timeout is in conflict with this connect timeout detection stuff.

Why do you want to set an explicit wsi timeout on it when it already now takes care of setting the connect timeout itself?  You're trying to set an overall timeout including all retries?  If we want that, we need to move the individual connect timeouts lws manages to its own private lws_sul.

-Andy

>
>    Huangkaicheng
>
>
>-----邮件原件-----
>发件人: Andy Green [mailto:andy at warmcat.com]
>发送时间: 2020年5月19日 23:09
>收件人: huangkaicheng <huangkaicheng at huawei.com>; libwebsockets 
><libwebsockets at ml.libwebsockets.org>
>抄送: Chenyake <chenyake at huawei.com>
>主题: Re: 答复: 回复: [Libwebsockets] 答复: A question about libwebsockets dns 
>resolve
>
>
>
>On 5/19/20 3:40 PM, huangkaicheng wrote:
>> Hi ,
>> 
>>     In my mac pro , I found that schedule of wait does not take
>effect
>> and" lws_client_conn_wait_timeout"  does not trigger when it try to 
>> connect to “127.0.0.1”. I have add some log for you. See more in 
>> attachment. I do not understand why”wait_timeout “is not trigger. And
>
>> I try it with “onevalid.bogus.warmcat.com”. please help to check why.
>Thanks.
>
>Dunno... but... I can usually do something about my code if it has 
>problems.  I can't do anything about your code.
>
>I can't reproduce your problem with my code (the minimal example), and 
>I tried it on a real OSX machine as you described.
>
>Do you have the same problem on your machine if you put your code on 
>one side, and try to repeat the exact same test I showed thismorning 
>using my minimal example alone?  In other words, does it need your code 
>to see the problem coming, or the problem exists without your code?
>
>Also if your test was supposed to be idle, because it's waiting for the 
>connect, it seems to be awful busy going around the event loop.  In my 
>test, the logs are completely idle while it waits for the connect 
>timeout.
>
>-Andy


More information about the Libwebsockets mailing list