Exemple #1
0
        /// <summary>
        ///     Initializes connection with the remote q service.
        /// </summary>
        public virtual void Open()
        {
            if (IsConnected())
            {
                return;
            }
            if (Host != null)
            {
                InitSocket();
                Initialize();

                Reader = new QReader(_stream, Encoding, MaxReadingChunk);
                Writer = new QWriter(_stream, Encoding, ProtocolVersion);
            }
            else
            {
                throw new QConnectionException("Host cannot be null");
            }
        }
        /// <summary>
        ///     Initializes connection with the remote q service.
        /// </summary>
        public virtual void Open()
        {
            if (!IsConnected())
            {
                if (Host != null)
                {
                    InitSocket();
                    Initialize();

                    Reader = new QReader(stream, Encoding, MaxReadingChunk);
                    Writer = new QWriter(stream, Encoding, ProtocolVersion);
                }
                else
                {
                    throw new QConnectionException("Host cannot be null");
                }
            }
        }