public void Poll(Uri subscription, ServiceEndPoint endPoint)
        {
            ISecureClient client;

            if (endPoint.IsWebSocketEndpoint)
            {
#if HAS_SERVICE_POINT_MANAGER
                client = new SecureWebSocketClient(endPoint, serverCertificate, logs.ForEndpoint(endPoint.BaseUri), pool);
#else
                throw new NotImplementedException("Web Sockets are not available on this platform");
#endif
            }
            else
            {
                client = new SecureClient(endPoint, serverCertificate, logs.ForEndpoint(endPoint.BaseUri), pool);
            }
            pollingClients.Add(new PollingClient(subscription, client, HandleIncomingRequest));
        }
Beispiel #2
0
        public void Poll(Uri subscription, ServiceEndPoint endPoint, CancellationToken cancellationToken)
        {
            ISecureClient client;
            var           log = logs.ForEndpoint(endPoint.BaseUri);

            if (endPoint.IsWebSocketEndpoint)
            {
#if SUPPORTS_WEB_SOCKET_CLIENT
                client = new SecureWebSocketClient(endPoint, serverCertificate, log, connectionManager);
#else
                throw new NotSupportedException("The netstandard build of this library cannot act as the client in a WebSocket polling setup");
#endif
            }
            else
            {
                client = new SecureClient(endPoint, serverCertificate, log, connectionManager);
            }
            pollingClients.Add(new PollingClient(subscription, client, HandleIncomingRequest, log, cancellationToken));
        }