Added Log property to the HttpListener class

This commit is contained in:
sta 2015-02-04 17:32:34 +09:00
parent 382efaac6e
commit a1da1a8ada
2 changed files with 10 additions and 1 deletions

View File

@ -74,6 +74,7 @@ namespace WebSocketSharp.Net
private bool _disposed; private bool _disposed;
private bool _ignoreWriteExceptions; private bool _ignoreWriteExceptions;
private bool _listening; private bool _listening;
private Logger _logger;
private HttpListenerPrefixCollection _prefixes; private HttpListenerPrefixCollection _prefixes;
private string _realm; private string _realm;
private bool _reuseAddress; private bool _reuseAddress;
@ -101,6 +102,8 @@ namespace WebSocketSharp.Net
_ctxRegistry = new Dictionary<HttpListenerContext, HttpListenerContext> (); _ctxRegistry = new Dictionary<HttpListenerContext, HttpListenerContext> ();
_ctxRegistrySync = ((ICollection) _ctxRegistry).SyncRoot; _ctxRegistrySync = ((ICollection) _ctxRegistry).SyncRoot;
_logger = new Logger ();
_prefixes = new HttpListenerPrefixCollection (this); _prefixes = new HttpListenerPrefixCollection (this);
_waitQueue = new List<HttpListenerAsyncResult> (); _waitQueue = new List<HttpListenerAsyncResult> ();
@ -117,6 +120,12 @@ namespace WebSocketSharp.Net
} }
} }
internal Logger Log {
get {
return _logger;
}
}
internal bool ReuseAddress { internal bool ReuseAddress {
get { get {
return _reuseAddress; return _reuseAddress;

View File

@ -141,7 +141,7 @@ namespace WebSocketSharp.Server
_port = port; _port = port;
_secure = secure; _secure = secure;
_listener = new HttpListener (); _listener = new HttpListener ();
_logger = new Logger (); _logger = _listener.Log;
_services = new WebSocketServiceManager (_logger); _services = new WebSocketServiceManager (_logger);
_state = ServerState.Ready; _state = ServerState.Ready;
_sync = new object (); _sync = new object ();