-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
关于服务端和多客户端的问题 #399
Comments
聊天机器人无实时性要求,请用 TCP |
单纯的学习实践一下,后面可能做游戏方面的。 |
|
感谢skywin3000的回复,我有点小白,第2点没看懂 |
那靠包头的 conv 区别用户,这个 conv 由你服务端分配,客户端带上来匹配,然后检测来源端口和地址是否匹配。 |
明白,感谢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我想实现一个类似聊天的程序,服务端是否这样来实现,有点模糊。
1,是否需要对应每个客户端都需要创建一个kcp(因为conv需要匹配)
2,如果socket收到数据,我如何对应相应的客户端,用IP和端口吗
例如:服务端一个udp socket,bind一个端口
客户端发送消息,在服务端会对每个第一次来消息的客户端连接都创建一个kcp(因为conv需要匹配),我在socket收到消息根据remote ip和port来判断对应的conv(是否合适),用这个conv的kcp来input,不知道这样使用有没有问题?
The text was updated successfully, but these errors were encountered: