comparison Net/HTTP.cs @ 12:ba8f94212c6e

Added WebSocket support
author Ivo Smits <Ivo@UCIS.nl>
date Sun, 17 Feb 2013 17:11:58 +0100
parents 7269e91c6e26
children 7c1808f28e05
comparison
equal deleted inserted replaced
11:2e0ff842aa4a 12:ba8f94212c6e
278 } 278 }
279 } 279 }
280 280
281 public interface IHTTPContentProvider { 281 public interface IHTTPContentProvider {
282 void ServeRequest(HTTPContext context); 282 void ServeRequest(HTTPContext context);
283 }
284 public delegate void HTTPContentProviderDelegate(HTTPContext context);
285 public class HTTPContentProviderFunction : IHTTPContentProvider {
286 public HTTPContentProviderDelegate Handler { get; private set; }
287 public HTTPContentProviderFunction(HTTPContentProviderDelegate handler) {
288 this.Handler = handler;
289 }
290 public void ServeRequest(HTTPContext context) {
291 Handler(context);
292 }
283 } 293 }
284 public class HTTPPathSelector : IHTTPContentProvider { 294 public class HTTPPathSelector : IHTTPContentProvider {
285 private List<KeyValuePair<String, IHTTPContentProvider>> Prefixes; 295 private List<KeyValuePair<String, IHTTPContentProvider>> Prefixes;
286 private StringComparison PrefixComparison; 296 private StringComparison PrefixComparison;
287 public HTTPPathSelector() : this(false) { } 297 public HTTPPathSelector() : this(false) { }