public SecureStream(IClient client)
            : base()
        {
            this.FlushLock = new object();
            this.stream    = new MemoryStream();
            this.Client    = client;

            lock (client.Connection)
            {
                RandomDecimal rnd = new RandomDecimal(DateTime.Now.Millisecond);
                StreamId = rnd.NextDecimal();
                while (client.Connection.Streams.ContainsKey(StreamId))
                {
                    StreamId = rnd.NextDecimal();
                }

                client.Connection.Streams.Add(StreamId, this);
                this.StreamLock = new SyncObject(client);
                client.Connection.SendMessage(new MsgOpenStream(this.StreamId), PacketId.StreamMessages);

                MsgOpenStreamResponse response = StreamLock.Wait <MsgOpenStreamResponse>(default(MsgOpenStreamResponse), 30000);

                if (response == null)
                {
                    throw new TimeoutException("It took too long for the remote host to setup the Stream");
                }

                IsOpen          = true;
                this.StreamLock = new SyncObject(client);
                this.ReadLock   = new SyncObject(client);
            }
        }