请教一下你发的例子

我对你写的remote文章很感兴趣。谢谢你的文章,我了解了很多的不知道的问题。其中我想问一下,在你的客户端订阅客户端事件的例子里的一个问题:

public void BroadCastingInfo(object info)
{
if (BroadCastEvent != null)
{
BroadCastEventHandler tempEvent = null;

int index = 1; //记录事件订阅者委托的索引,为方便标识,从1开始。
foreach (Delegate del in BroadCastEvent.GetInvocationList())
{
try
{
tempEvent = (BroadCastEventHandler)del;


//这里怎么区别发到哪个IP上??我要把广播消息过滤发出如只发给指定的用户IP,这个控制应该加到哪里,如何实现,谢谢。
tempEvent(info);
}
catch
{
MessageBox.Show("事件订阅者" + index.ToString() + "发生错误,系统将取消事件订阅!");
BroadCastEvent -= tempEvent;
}
index++;
}
}
else
{
MessageBox.Show("事件未被订阅或订阅发生错误!");
}
}
posted @ 2005-11-09 09:48  张逸  阅读(167)  评论(0)    收藏  举报