Exemplo n.º 1
0
 internal Builder(CommunicationIT outerInstance, int port, int chunkSize, sbyte internalProtocolVersion, sbyte applicationProtocolVersion, TxChecksumVerifier verifier, StoreId storeId)
 {
     this._outerInstance    = outerInstance;
     this.PortConflict      = port;
     this.ChunkSizeConflict = chunkSize;
     this.InternalProtocolVersionConflict    = internalProtocolVersion;
     this.ApplicationProtocolVersionConflict = applicationProtocolVersion;
     this.VerifierConflict = verifier;
     this.StoreIdConflict  = storeId;
 }
Exemplo n.º 2
0
 public Server(T requestTarget, Configuration config, LogProvider logProvider, int frameLength, ProtocolVersion protocolVersion, TxChecksumVerifier txVerifier, Clock clock, ByteCounterMonitor byteCounterMonitor, RequestMonitor requestMonitor)
 {
     this._requestTarget = requestTarget;
     this._config        = config;
     this._frameLength   = frameLength;
     this._applicationProtocolVersion = protocolVersion.ApplicationProtocol;
     this._logProvider            = logProvider;
     this._msgLog                 = this._logProvider.getLog(this.GetType());
     this._txVerifier             = txVerifier;
     this._byteCounterMonitor     = byteCounterMonitor;
     this._requestMonitor         = requestMonitor;
     this._connectedSlaveChannels = new IdleChannelReaper(this, logProvider, clock, config.OldChannelThreshold);
     this._chunkSize              = config.ChunkSize;
     assertChunkSizeIsWithinFrameSize(_chunkSize, frameLength);
 }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void serverContextVerificationCanThrowException()
        public virtual void ServerContextVerificationCanThrowException()
        {
            const string       failureMessage  = "I'm failing";
            TxChecksumVerifier failingVerifier = (txId, checksum) =>
            {
                throw new FailingException(failureMessage);
            };

            MadeUpServer server = _builder.verifier(failingVerifier).server();
            MadeUpClient client = _builder.client();

            AddToLifeAndStart(server, client);

            try
            {
                client.Multiply(10, 5);
                fail("Should have failed");
            }
            catch (Exception)
            {               // Good
                // TODO catch FailingException instead of Exception and make Server throw the proper
                // one instead of getting a "channel closed".
            }
        }
Exemplo n.º 4
0
 internal virtual Builder Verifier(TxChecksumVerifier verifier)
 {
     return(new Builder(_outerInstance, PortConflict, ChunkSizeConflict, InternalProtocolVersionConflict, ApplicationProtocolVersionConflict, verifier, StoreIdConflict));
 }
Exemplo n.º 5
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: MadeUpServer(MadeUpCommunicationInterface requestTarget, final int port, byte internalProtocolVersion, byte applicationProtocolVersion, TxChecksumVerifier txVerifier, final int chunkSize)
		 internal MadeUpServer( MadeUpCommunicationInterface requestTarget, int port, sbyte internalProtocolVersion, sbyte applicationProtocolVersion, TxChecksumVerifier txVerifier, int chunkSize ) : base(requestTarget, new ConfigurationAnonymousInnerClass(port, chunkSize)