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> ();
        }
示例#2
0
 public HttpWebRequest CreateRequest(Listener listener)
 {
     var uri = RegisterRequest (listener);
     return CreateRequest (uri);
 }
示例#3
0
        internal Uri RegisterRequest(Listener listener)
        {
            lock (this) {
                if (hasRequest)
                    throw new InvalidOperationException ();
                hasRequest = true;

                return listener.RegisterHandler (this);
            }
        }