Beispiel #1
0
        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        //ORIGINAL LINE: @Override public Connection createConnection(String targetIP, int targetPort, int connectTimeout) throws Exception
        public virtual Connection createConnection(IPAddress targetIP, int targetPort, int connectTimeout)
        {
            IChannel   channel = doCreateConnection(targetIP, targetPort, connectTimeout);
            Connection conn    = new Connection(channel, ProtocolCode.fromBytes(RpcProtocol.PROTOCOL_CODE), RpcProtocolV2.PROTOCOL_VERSION_1, new Url(targetIP, targetPort));

            channel.Pipeline.FireUserEventTriggered(ConnectionEventType.CONNECT);
            return(conn);
        }
Beispiel #2
0
        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        //ORIGINAL LINE: @Override public Connection createConnection(Url url) throws Exception
        public virtual Connection createConnection(Url url)
        {
            IChannel   channel = doCreateConnection(url.Ip, url.Port, url.ConnectTimeout);
            Connection conn    = new Connection(channel, ProtocolCode.fromBytes(url.Protocol), url.Version, url);

            channel.Pipeline.FireUserEventTriggered(ConnectionEventType.CONNECT);
            return(conn);
        }
 /// <summary>
 /// decode the protocol code
 /// </summary>
 /// <param name="in"> input byte buf </param>
 /// <returns> an instance of ProtocolCode </returns>
 protected internal virtual ProtocolCode decodeProtocolCode(IByteBuffer @in)
 {
     if (@in.ReadableBytes >= protocolCodeLength)
     {
         byte[] protocolCodeBytes = new byte[protocolCodeLength];
         @in.ReadBytes(protocolCodeBytes);
         return(ProtocolCode.fromBytes(protocolCodeBytes));
     }
     return(null);
 }
 public virtual IChannelHandler newEncoder()
 {
     return(new ProtocolCodeBasedEncoder(ProtocolCode.fromBytes(RpcProtocolV2.PROTOCOL_CODE)));
 }
Beispiel #5
0
 /// <seealso cref= RemotingServer#registerDefaultExecutor(byte, ExecutorService) </seealso>
 public override void registerDefaultExecutor(byte protocolCode, ExecutorService executor)
 {
     ProtocolManager.getProtocol(ProtocolCode.fromBytes(protocolCode)).CommandHandler.registerDefaultExecutor(executor);
 }
Beispiel #6
0
 /// <seealso cref= RemotingServer#registerProcessor(byte, CommandCode, RemotingProcessor) </seealso>
 public override void registerProcessor(byte protocolCode, CommandCode cmd, RemotingProcessor processor)
 {
     ProtocolManager.getProtocol(ProtocolCode.fromBytes(protocolCode)).CommandHandler.registerProcessor(cmd, processor);
 }