コード例 #1
0
        public static AeronClient GetClientReference(string path, Func <string, ClientServerConfig>?mdConfigFactory)
        {
            path = Path.GetFullPath(path);

            lock (_clientsLock)
            {
                if (!_clients.TryGetValue(path, out var client))
                {
                    client = new AeronClient(mdConfigFactory?.Invoke(path) ?? new ClientServerConfig(path));
                    _clients.Add(path, client);
                }

                client._referenceCount++;
                return(client);
            }
        }
コード例 #2
0
 public AeronClientSession(AeronClient client,
                           string serverChannel,
                           Publication publication,
                           Subscription subscription,
                           Action onConnected,
                           Action onDisconnected,
                           AeronClientMessageReceivedHandler onMessageReceived)
 {
     _client            = client;
     _serverChannel     = serverChannel;
     _publication       = publication;
     _buffer            = new UnsafeBuffer();
     Subscription       = subscription;
     OnDisconnected     = onDisconnected;
     _onMessageReceived = onMessageReceived;
     _onConnected       = onConnected;
     _isConnected       = false;
     _fragmentAssembler = new FragmentAssembler(HandlerHelper.ToFragmentHandler(SubscriptionHandler));
 }