After the program runs, it needs to be tested with multiple Telnet clients
The connected command is Conn DeviceNumber
Broadcast command for Broa message
It is important to note that the sample code has a bug,
The storage of the broadcastdict itself is the counterpart of the Cxxx and the device collection
broadcastdict["C001"] =Newlist<string> {"V001" }; broadcastdict["C002"] =Newlist<string> {"V001","V002" }; broadcastdict["C003"] =Newlist<string> {"V002"};
But when used in the back, the inside as a judge of the use of the session. DeviceNumber
lock (Broadcastsyncroot) { // key: The key of the value to get. // value: When this method returns a value, if the key is found, Returns the value associated with the specified key, // Otherwise, the value parameter is returned The type default value of the number. The parameter is passed without initialization. bool flag = Broadcastdict.trygetvalue (session. DeviceNumber, out targetdevicenumbers); if (flag = = false return ; } }
Test cases for Broadcastservice