Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

把客户端的descriptor换成端口号或进程ID岂不更好? #1

Open
ghost opened this issue May 22, 2018 · 1 comment
Open

Comments

@ghost
Copy link

ghost commented May 22, 2018

No description provided.

@coologic
Copy link
Owner

连接句柄的源头是重写的incomingConnection(qintptr socketDescriptor)方法的参数,也就是qt自身传进来的。当有连接断开时也是出发了这个ClientDisconnectedSlot(qintptr socketDescriptor)槽函数。
我并没有看qt实现的源码,也许看过源码后有更好的处理方式能够更便捷快速的确定具体的客户端信息。当前我看来handle不是自己掌控的,所以还是用的默认的。
你的意思是可以通过设置客户端的descriptor实现服务端的socketDescriptor参数变动?如果是这样,不同的客户端设置了相同的descriptor服务端这不就无法识别了?我感觉应该是连入以后服务端随机给的一个唯一handle用来标识这个链接

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant