且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Remoting问题:客户端首先启动然后启动服务器

更新时间:2022-10-25 09:55:20

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

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