예제 #1
0
      public Stream Connect(IBrokerInfo broker)
      {
         MCertificate cert = GetClientCert(broker);
         SecurityOptions options = new SecurityOptions(
            SecureProtocol.Tls1, cert, ConnectionEnd.Client
            );
         if ( broker.SslOptions != null 
            && broker.SslOptions.IgnoreValidationErrors )
         {
            _logger.Warn("Ignoring any certificate validation errors during SSL handshake...");
            options.VerificationType = CredentialVerification.None;
         }

         _tcpClient = new MyTcpClient(broker.Host, broker.Port, options);
         return _tcpClient.GetStream();
      }
예제 #2
0
        public Stream Connect(IBrokerInfo broker)
        {
            MCertificate    cert    = GetClientCert(broker);
            SecurityOptions options = new SecurityOptions(
                SecureProtocol.Tls1, cert, ConnectionEnd.Client
                );

            if (broker.SslOptions != null &&
                broker.SslOptions.IgnoreValidationErrors)
            {
                _logger.Warn("Ignoring any certificate validation errors during SSL handshake...");
                options.VerificationType = CredentialVerification.None;
            }

            _tcpClient = new MyTcpClient(broker.Host, broker.Port, options);
            return(_tcpClient.GetStream());
        }
예제 #3
0
 public Stream Connect(IBrokerInfo broker)
 {
     _tcpClient = new MyTcpClient(broker.Host, broker.Port);
     return(_tcpClient.GetStream());
 }
예제 #4
0
        /// <summary>
        /// send a string of data over the socket
        /// </summary>
        /// <param name="sData">The data to send</param>
        private void Send(string sData)
        {
            byte[] bSend = ASCII.GetBytes(sData + Environment.NewLine);

            socket.GetStream().Write(bSend, 0, bSend.Length);
        }
예제 #5
0
 public Stream Connect(IBrokerInfo broker)
 {
    _tcpClient = new MyTcpClient(broker.Host, broker.Port);
    return _tcpClient.GetStream();
 }