Remoting问题:客户端首先启动然后启动服务器 [英] Issue with Remoting : Client start first then start server

查看:59
本文介绍了Remoting问题:客户端首先启动然后启动服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我创建了两个applciations客户端和服务器使用远程处理他们工作正常如果我先启动

服务器应用程序然后客户申请。但是当我首先启动客户端应用程序

然后servert应用程序然后应用程序无法正常工作。为什么它会发生。我希望任何应用程序首先运行它应该工作。有什么方法是什么问题



服务器端

 ipcCh =  IpcChannel(  IPChannelName

ChannelServices.RegisterChannel(ipcCh, False
RemotingConfiguration.RegisterWellKnownServiceType(_
GetType (CommunicationService), SreeniRemoteObj,_
WellKnownObjectMode.Singleton)





客户端

  Dim  ipcCh 作为  IpcChannel(  myClient
ChannelServices.Regi sterChannel(ipcCh, False

Dim obj As ICommunicationService = _
DirectCast (Activator.GetObject( GetType (ICommunicationService),_
ipc:// IPChannelName / SreeniRemoteObj),ICommunicationService )
obj.SaySomething(sTN)

ChannelServices.UnregisterChannel(ipcCh)











谢谢

解决方案

通过远程处理,您可以使用客户端的方法 - 激活的远程对象。请参阅:

http://msdn.microsoft.com/en-us /library/ms973857.aspx [ ^ ],

http:/ /msdn.microsoft.com/en-us/library/0x5kd2ah%28v=vs.80%29.aspx [ ^ ]。



-SA

Hi,

I created two applciations Client and Server using remoting they are working fine if I start
server application first and then client application. but when I start client application first
then servert application then applications not working. why its happenning. I want any application run first it should work.Is there any way what is problem

server side

ipcCh = New IpcChannel("IPChannelName")

            ChannelServices.RegisterChannel(ipcCh, False)
            RemotingConfiguration.RegisterWellKnownServiceType( _
            GetType(CommunicationService), "SreeniRemoteObj", _
            WellKnownObjectMode.Singleton)



Client side

Dim ipcCh As New IpcChannel("myClient")
            ChannelServices.RegisterChannel(ipcCh, False)

            Dim obj As ICommunicationService = _
            DirectCast(Activator.GetObject(GetType(ICommunicationService), _
            "ipc://IPChannelName/SreeniRemoteObj"), ICommunicationService)
            obj.SaySomething(sTN)

            ChannelServices.UnregisterChannel(ipcCh)






Thanks

解决方案

With remoting, you can use the approach of client-activated remote object. Please see:
http://msdn.microsoft.com/en-us/library/ms973857.aspx[^],
http://msdn.microsoft.com/en-us/library/0x5kd2ah%28v=vs.80%29.aspx[^].

—SA


这篇关于Remoting问题:客户端首先启动然后启动服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆