示例#1
0
        public static RpcClient CreateTcp( EndPoint remoteEndPoint, ClientEventLoop eventLoop, RpcClientOptions options )
        {
            RpcTransportException failure = null;
            var transport =
                new TcpClientTransport(
                    remoteEndPoint,
                    options.ForceIPv4.GetValueOrDefault() ? RpcTransportProtocol.TcpIpV4 : RpcTransportProtocol.TcpIp,
                    eventLoop,
                    options
                );
            if ( failure != null )
            {
                throw failure;
            }

            return new RpcClient( transport );
        }
示例#2
0
 public static RpcClient CreateUdp( EndPoint remoteEndPoint, ClientEventLoop eventLoop, RpcClientOptions options )
 {
     var transport =
         new UdpClientTransport(
             ClientServices.SocketFactory(
                 ( options.ForceIPv4.GetValueOrDefault() ? RpcTransportProtocol.UdpIpV4 : RpcTransportProtocol.UdpIp ).CreateSocket()
             ),
             remoteEndPoint,
             eventLoop,
             options
         );
     return new RpcClient( transport );
 }