回复:[openresty] 如何判断cosocket是新的还是从连接池中取出来的?

66 views
Skip to first unread message

Gerrard

unread,
Jul 27, 2021, 10:53:37 AM7/27/21
to open...@googlegroups.com
2021年07月27日 19:13tomm...@shopee.com<tomm...@shopee.com> 写道:
hi, 各位:

背景: 从连接池中取出连接后,如果是新连接,则额外做一些初始化操作,然后发业务请求。否则直接发业务请求。

有没有啥办法知道一个socket是新的还是旧的(之前放进去的)

--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html
---
您收到此邮件是因为您订阅了Google网上论坛上的“openresty”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到openresty+...@googlegroups.com
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/openresty/b097c029-8c66-420f-b736-7c11db42a112n%40googlegroups.com

Chan WingChung

unread,
Dec 11, 2021, 8:43:46 AM12/11/21
to openresty
没什么新旧,你可以做个dict,之后初始化等于登录,更新到dict,那就可以做全局唯一了。
Reply all
Reply to author
Forward
0 new messages