本来网上看了remoting信道的原理,并做了个Demo,可是怎么都不能将自己的sink挂到remoting的信道中,有知道的支个招。或者有这方面可以运行的源码也行。
我的代码如下:
在client.config中
<channels>
        <channel ref="tcp client" />
        <clientProviders>
          <formatter ref ="binary"/>
          <provider type ="TimeClient.myClientSinkProvider, TimeClient"/>
        </clientProviders>
      </channels>在Server.config中
 <channels>
        <channel ref="tcp server" port="1234" />
        <serverProviders>
          <provider ref="wsdl" />
          <formatter ref="binary"/>
          <provider type="TimeServer.myServerSinkProvider, TimeServer"/>         
        </serverProviders>
      </channels>
好像自定义的sink是没有问题的,但是一直跟踪不到。

解决方案 »

  1.   

    static void Main()
        { 
          RemotingConfiguration.Configure     (AppDomain.CurrentDomain.BaseDirectory+"\\"+"TimeClient.exe.config",false);        Clock.Clock aa = (Clock.Clock)Activator.GetObject(typeofClock.Clock) ,   "tcp://localhost:1234/Clock" );
            string bb = aa.GetCurrentTime();
            Console.WriteLine(aa.GetCurrentTime()); 
    }
    客户端的调用
      

  2.   

    <client>
            <wellknown type="Remoting.RemoteObject,RemoteObject" url="tcp://localhost:6791/CallbackSample" />
          </client>
    <channels>
    <channel ref="tcp" port="0">
    <serverProviders>
    <provider ref="binary" typeFilterLevel="Full" />
    </serverProviders>
    </channel>
    </channels>
    <service>
                <!--<activated type="Remoting.RemoteObject, 
                                 RemoteObject" />-->
               <wellknown mode="Singleton" type="Remoting.RemoteObject, 
                                 RemoteObject" objectUri="CallbackSample" />
             </service>
             <channels>
                <channel ref="tcp" port="6791">
                  <serverProviders>
                    <provider ref="binary" typeFilterLevel="Full" />
                  </serverProviders>
                </channel>
             </channels>
      

  3.   

    你可以留下你的邮箱,我有一个DEMO发给你研究一下
      

  4.   

    to yxm555111(yxm555111)
    你的配置文件明显不行,都没有把自定义的sink(即TimeClient.myClientSinkProvider等)配置进去。我是按照:http://www.cnblogs.com/idior/archive/2007/01/09/611265.html 上的图2结构写的。
    不过想看看你的Demo,麻烦发一下,谢谢! [email protected]