日期:2014-05-19  浏览次数:20706 次

socket中如何实现广播?
最近开始学socket编程,不知道如何实现广播,请大侠指教

谢谢

------解决方案--------------------
private void SendToClients(CSocketConnection sender, string e)
{
CSocketConnection client;
foreach (DictionaryEntry entry in clients)
{
client = (CSocketConnection)entry.Value;
if (client.ClientName != sender.ClientName)
{
client.SendString(e);
}
}
}