lua-resty-websocket icon indicating copy to clipboard operation
lua-resty-websocket copied to clipboard

Http链接重复利用给websocket时的错误

Open bazhi opened this issue 7 years ago • 1 comments

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

-- do the websocket handshake:

当一个http链接关闭之后,如果这个http链接,被websocket链接从链接池里面取出来时,则这个链接的reusedtimes时大于0的,然后这个链接不会被handshake。

bazhi avatar Dec 08 '18 07:12 bazhi

@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.

agentzh avatar Feb 04 '19 06:02 agentzh