【发布时间】:2014-02-17 20:55:43
【问题描述】:
我正在开发 TCP 客户端-服务器控制台应用程序。我有 N 个客户端连接到服务器。在服务器端,我需要共享 M 条记录,并且每条记录应该只发送一次给客户端。每条记录只能由 1 个客户接收。 例如记录数 N=4 和客户数 M=10,结果应该是:
record1 – to client1
record2 – to client2
record3 – to client3
record4 – to client4
record5 – to client1
record6 – to client2
record7 – to client3
record9 – to client4
record10 – to client5
问题是记录数 M 是固定的,但客户数 N 不固定(有时 N=3,有时 N=5,等等)
您能否建议我一个解决方案来组织这种类型的流量控制?
【问题讨论】:
标签: c# .net sockets tcpclient tcpserver