问题描述
大家好,我有一个服务器应用程序,它接受多个客户端。我正在使用TcpListener类并使用异步AcceptClient方法我为每个连接的客户端创建一个单独的线程。并且这些线程分别从自己的TsClClient回调获取的TcpClient套接字中读取。他们不断读取数据包并排队。是否可以通过客户端B的线程捕获客户端A发送的数据包?我没有实现任何客户端识别机制。我只依赖于AcceptClient方法产生的单独的TcpClient对象。够了吗 ?因为我感觉数据包混乱严重... :(
Hi all, I have a server application and it accepts multiple clients. I'm using the TcpListener class and using async AcceptClient method I create a seperate thread for each client that connects. And these threads seperately reads from their own TcpClient sockets obtained by the AcceptClient callback. They constantly read packets and queue them. Is it possible if a packet sent by Client A can be captured by Client B's thread ? I haven't implemented any client identification mechanism. I just rely on the seperate TcpClient objects yielded by the AcceptClient method. Is that enough ? Cause I sense that the packets are mixed up badly... :(
这篇关于如何分离不同客户端发送的数据包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!