Exemplo n.º 1
0
        private void openConnection()
        {
            try
            {
                if (this.tcp_client == null)
                {
                    this.tcp_client = new LogentriesTcpClient(HttpPut, Ssl);
                }

                this.tcp_client.Connect();

                if (HttpPut)
                {
                    String header = String.Format("PUT /{0}/hosts/{1}/?realtime=1 HTTP/1.1\r\n\r\n", this.m_Key, this.m_Location);
                    this.tcp_client.Write(ASCII.GetBytes(header), 0, header.Length);
                }
            }
            catch
            {
                throw new IOException();
            }
        }
Exemplo n.º 2
0
        private void openConnection()
        {
            try
            {
                if (this.tcp_client == null)
                    this.tcp_client = new LogentriesTcpClient(HttpPut, Ssl);

                this.tcp_client.Connect();

                if (HttpPut)
                {
                    String header = String.Format("PUT /{0}/hosts/{1}/?realtime=1 HTTP/1.1\r\n\r\n", this.m_Key, this.m_Location);
                    this.tcp_client.Write(ASCII.GetBytes(header), 0, header.Length);
                }
            }
            catch
            {
                throw new IOException();
            }
        }
Exemplo n.º 3
0
        protected virtual void OpenConnection()
        {
            try
            {
                if (TcpClient == null)
                    TcpClient = new LogentriesTcpClient(UseHttpPut, UseSsl);

                TcpClient.Connect();

                if (UseHttpPut)
                {
                    var header = String.Format("PUT /{0}/hosts/{1}/?realtime=1 HTTP/1.1\r\n\r\n", m_AccountKey, m_Location);
                    TcpClient.Write(ASCII.GetBytes(header), 0, header.Length);
                }
            }
            catch (Exception ex)
            {
                throw new IOException("An error occurred while opening the connection.", ex);
            }
        }