private static ZerioConfiguration CreateConfiguration() { var zerioConfiguration = ZerioConfiguration.CreateDefault(); zerioConfiguration.SessionCount = 1; return(zerioConfiguration); }
public static ZerioConfiguration CreateDefault() { // const int allocationGranularity = 65536; var configuration = new ZerioConfiguration { MaxSendBatchSize = 16, SessionCount = 2, SendingBufferLength = 1024, SendingBufferCount = 64 * 1024, ReceivingBufferLength = 64 * 1024, ReceivingBufferCount = 4, RequestEngineWaitStrategyType = RequestEngineWaitStrategyType.HybridWaitStrategy, ReceiveCompletionPollingWaitStrategyType = CompletionPollingWaitStrategyType.BusySpinWaitStrategy, SendCompletionPollingWaitStrategyType = CompletionPollingWaitStrategyType.SpinWaitWaitStrategy, }; configuration.FramingBufferLength = configuration.ReceivingBufferLength; configuration.MaxSendCompletionResults = configuration.SendingBufferCount; configuration.MaxReceiveCompletionResults = configuration.ReceivingBufferCount; return(configuration); }
public ZerioServer(int listeningPort) { WinSock.EnsureIsInitialized(); _listeningPort = listeningPort; _configuration = CreateConfiguration(); _completionQueues = CreateCompletionQueues(); _sessionManager = CreateSessionManager(); _requestProcessingEngine = CreateRequestProcessingEngine(); _receiveCompletionProcessor = CreateReceiveCompletionProcessor(); _listeningSocket = CreateListeningSocket(); }
public ZerioClient(IPEndPoint serverEndpoint) { _serverEndpoint = serverEndpoint; WinSock.EnsureIsInitialized(); _configuration = CreateConfiguration(); _completionQueues = CreateCompletionQueues(); _sessionManager = CreateSessionManager(); _requestProcessingEngine = CreateRequestProcessingEngine(); _receiveCompletionProcessor = CreateReceiveCompletionProcessor(); _session = _sessionManager.Acquire(); _session.HandshakeReceived += OnHandshakeReceived; _session.Closed += OnSessionClosed; }
private static ZerioConfiguration CreateConfiguration() { return(ZerioConfiguration.CreateDefault()); }