当tcp服务器被多个客户端连接时,我怎么区分各个客户端,包括给各个客户端发不同的消息
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
那是不是建立多个连接,每个客户端都要对应一个SOCKET才行,那既然这样的话,怎么建立对应当前连接客户端的SOCKET呢?
之前有看到过这篇BLOG,有往这个方向去想,但是查了资料,并没有看到BIOS中创建线程函数中可以代入参数(该参数可以被SOCKET引用),所以这个方法暂时就被搁置了,所以就来请教下,还有什么方法没
看一下以下帖子中的回复:
https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1027601/tms320c6657-tcp-server-connects-multiple-clients
您可以看一下file descriptor,在SOCKET中,每个客户端都被分配了一个file descriptor,可通过file descriptor来区分,如果有问题我再帮您跟进。
3.1 File Descriptor Environment
https://www.ti.com/lit/ug/spru524k/spru524k.pdf