public void SetUp() { ClientSendBuffer = new ConcurrentCircularBuffer <NetworkData>(BufferSize); ClientReceiveBuffer = new ConcurrentCircularBuffer <NetworkData>(BufferSize); _clientExecutor = new AssertExecutor(); _serverExecutor = new AssertExecutor(); var serverBootstrap = new ServerBootstrap() .WorkerThreads(2) .Executor(_serverExecutor) .SetTransport(TransportType) .SetEncoder(Encoder) .SetDecoder(Decoder) .SetAllocator(Allocator) .SetConfig(Config) .Build(); _server = serverBootstrap.NewConnection(Node.Loopback()); _clientConnectionFactory = new ClientBootstrap() .Executor(_clientExecutor) .SetTransport(TransportType) .SetEncoder(Encoder) .SetDecoder(Decoder) .SetAllocator(Allocator) .SetConfig(Config) .Build(); }
protected MultiNodeTest() { if (!HighPerformance) { ClientSendBuffer = new ConcurrentCircularBuffer <NetworkData>(BufferSize); ClientReceiveBuffer = new ConcurrentCircularBuffer <NetworkData>(BufferSize); ServerReceiveBuffer = new ConcurrentCircularBuffer <NetworkData>(BufferSize); } ClientReceived = new AtomicCounter(0); ServerReceived = new AtomicCounter(0); _clientExecutor = new AssertExecutor(); _serverExecutor = new AssertExecutor(); var serverBootstrap = new ServerBootstrap() .WorkerThreads(2) .Executor(_serverExecutor) .WorkerThreads(WorkerThreads) .SetTransport(TransportType) .SetEncoder(Encoder) .SetDecoder(Decoder) .SetAllocator(Allocator) .SetConfig(Config) .Build(); _server = serverBootstrap.NewConnection(Node.Loopback()); _clientConnectionFactory = new ClientBootstrap() .Executor(_clientExecutor) .WorkerThreads(WorkerThreads) .SetTransport(TransportType) .SetEncoder(Encoder) .SetDecoder(Decoder) .SetAllocator(Allocator) .SetConfig(Config) .Build(); }