Exemplo n.º 1
0
        public Connection(Listener server, Socket socket)
        {
            this.server = server;

            stream = new NetworkStream (socket);

            reader = new StreamReader (stream);
            writer = new StreamWriter (stream);
            headers = new Dictionary<string, string> ();
        }
Exemplo n.º 2
0
 public HttpWebRequest CreateRequest(Listener listener)
 {
     var uri = RegisterRequest (listener);
     return CreateRequest (uri);
 }
Exemplo n.º 3
0
        internal Uri RegisterRequest(Listener listener)
        {
            lock (this) {
                if (hasRequest)
                    throw new InvalidOperationException ();
                hasRequest = true;

                return listener.RegisterHandler (this);
            }
        }