关于客户端和服务器之间的tcp连接

问题描述:

你好,
我们可以使用相同的端口地址将多个客户端连接到服务器吗?
Thnx
问候,
Vishavdeep Goyal

Hello,
Can we connect multiple clients to a server with the use of same port address?
Thnx
Regards,
Vishavdeep Goyal

请参阅我过去提供的关于类似问题的设计草图: ^ ].

您可以在不同级别上使用TCP网络.请查看我过去的答案中对它们的概述:
如何将byte []发送到另一台PC [ ^ ],
在局域网上与两个Windows应用程序进行通信. [ ^ ].

—SA
Please see this design sketch I provided in my past answer to the similar question: Multple clients from same port Number[^].

You can use TCP networking on different level. Please see my overview of them in my past answers:
how i can send byte[] to other pc[^],
Communication b/w two Windows applications on LAN.[^].

—SA


是的,我们可以通过同一端口将多个客户端连接到服务器.在服务器上,我们可以指定与套接字(欢迎套接字)的连接的阈值数.一旦连接,客户端将通过欢迎套接字分配的另一个端口进行操作.
yes , we can connect multiple clients to a server through same port. At the Server we can specify a threshold number of connections to a socket(welcome Socket). once connected the client will carry operations through another port assigned by welcome socket.