比如:
RemotingConfiguration::RegisterActivatedClientType(Type::GetType(L"RemoteUser.User, RemoteUser"),"tcp://202.1.34.4/RemoteUser");如果服务器不在局域网,可以直接写202.1.34.4
但是如果服务器外网地址为202.1.34.4,局域网内地址为192.168.0.3
客户端如何获得远程对象呢?

解决方案 »

  1.   

    这个得你的网关能把从外网来的数据转发给内网的服务器(DMZ,映射等)。一般来说,对外网服务的服务器一般应该有单独的公网地址(或者说直接放在公网上)。
      

  2.   

    似乎找到方法了,不知道对不对
    IDictionary   tcpProperties   =   new   Hashtable();           
        tcpProperties[ "name "]     =       "tcpBinary ";           
        tcpProperties[ "port "]       =       8888;           
        tcpProperties[ "rejectRemoteRequests "]       =       false;           
        tcpProperties[ "bindTo "]       =       外网IP;       //注:使用IP地址绑定时将无法使用其它IP地址连接           
        BinaryClientFormatterSinkProvider       tcpClientSinkProvider       =       new       BinaryClientFormatterSinkProvider();           
        BinaryServerFormatterSinkProvider       tcpServerSinkProvider       =       new       BinaryServerFormatterSinkProvider();           
        tcpServerSinkProvider.TypeFilterLevel       =       TypeFilterLevel.Full;           
        TcpChannel       tcpChannel       =       new       TcpChannel(tcpProperties,tcpClientSinkProvider,tcpServerSinkProvider);           http://topic.csdn.net/u/20070531/12/5ee40856-4a78-4712-9e79-2e6b964d51b3.html