Exemple #1
0
 public static Task AuthenticateAsClientAsync(this SslStream stream, ClientSslConfiguration configuration)
 {
     return(stream.AuthenticateAsClientAsync(configuration.TargetHost,
                                             configuration.ClientCertificates,
                                             configuration.EnabledSslProtocols,
                                             configuration.CheckCertificateRevocation));
 }
        public RawSocketClientConnection
            (Func <TcpClient> clientBuilder,
            Func <TcpClient, Task> connector,
            IWampStreamingMessageParser <TMessage> parser,
            TimeSpan?autoPingInterval,
            ClientSslConfiguration sslConfiguration = null)
        {
            mClientBuilder = clientBuilder;
            mConnector     = connector;

            if (!(parser is JsonBinding <TMessage> || parser is MsgPackBinding <TMessage>))
            {
                throw new ArgumentException("Expected Json or MsgPack binding", nameof(parser));
            }

            mParser           = parser;
            mAutoPingInterval = autoPingInterval;
            mSslConfiguration = sslConfiguration;
        }