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