【发布时间】:2009-01-29 08:48:41
【问题描述】:
我正在像这样设置我的远程连接:
port = new Random().Next(REMOTING_PORT_MIN, REMOTING_PORT_MAX);
TcpChannel chan = new TcpChannel(port);
ChannelServices.RegisterChannel(chan, false);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(NotificationService), "CallOnMe.rem", WellKnownObjectMode.Singleton);
notService = new NotificationService();
notService.NotificationMessageEvent += new NotificationService.NotificationMessageEventHandler(notService_NotificationMessageEvent);
RemotingServices.Marshal(notService, "CallOnMe.rem");
但是每隔一段时间就会丢失连接,需要重新建立连接,我该如何检查连接是否仍然打开?
【问题讨论】: