You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local count, err = sock:getreusedtimes()
if not count then
return nil, "failed to get reused times: " .. err
end
if count > 0 then
-- being a reused connection (must have done handshake)
return 1
end
@bazhi Please, do not use Chinese here. This place is considered English only. If you really want to use Chinese, please join and post to the openresty (Chinese) mailing list instead. Please see https://openresty.org/en/community.html Thanks for your cooperation.
Regarding to your question, it is wrong to do repeated websocket handshakes on a connection that has already done websocket handshake.
websocekt/client.lua
local count, err = sock:getreusedtimes()
if not count then
return nil, "failed to get reused times: " .. err
end
if count > 0 then
-- being a reused connection (must have done handshake)
return 1
end
当一个http链接关闭之后,如果这个http链接,被websocket链接从链接池里面取出来时,则这个链接的reusedtimes时大于0的,然后这个链接不会被handshake。
The text was updated successfully, but these errors were encountered: