diff --git a/Example/Example.pidb b/Example/Example.pidb index 5697c22c..e8b5caa6 100644 Binary files a/Example/Example.pidb and b/Example/Example.pidb differ diff --git a/Example/bin/Debug/example.exe b/Example/bin/Debug/example.exe index 0ae10077..46d28ec6 100755 Binary files a/Example/bin/Debug/example.exe and b/Example/bin/Debug/example.exe differ diff --git a/Example/bin/Debug/example.exe.mdb b/Example/bin/Debug/example.exe.mdb index 59c9cbc1..a1b72f2b 100644 Binary files a/Example/bin/Debug/example.exe.mdb and b/Example/bin/Debug/example.exe.mdb differ diff --git a/Example/bin/Debug/websocket-sharp.dll b/Example/bin/Debug/websocket-sharp.dll index b6615231..96bfd3f1 100755 Binary files a/Example/bin/Debug/websocket-sharp.dll and b/Example/bin/Debug/websocket-sharp.dll differ diff --git a/Example/bin/Debug/websocket-sharp.dll.mdb b/Example/bin/Debug/websocket-sharp.dll.mdb index 683cee97..76c6cfe0 100644 Binary files a/Example/bin/Debug/websocket-sharp.dll.mdb and b/Example/bin/Debug/websocket-sharp.dll.mdb differ diff --git a/Example/bin/Debug_Ubuntu/example.exe b/Example/bin/Debug_Ubuntu/example.exe index 042a1f30..fe86bd98 100755 Binary files a/Example/bin/Debug_Ubuntu/example.exe and b/Example/bin/Debug_Ubuntu/example.exe differ diff --git a/Example/bin/Debug_Ubuntu/example.exe.mdb b/Example/bin/Debug_Ubuntu/example.exe.mdb index 131d5676..106ca790 100644 Binary files a/Example/bin/Debug_Ubuntu/example.exe.mdb and b/Example/bin/Debug_Ubuntu/example.exe.mdb differ diff --git a/Example/bin/Debug_Ubuntu/websocket-sharp.dll b/Example/bin/Debug_Ubuntu/websocket-sharp.dll index 8f734496..2b866264 100755 Binary files a/Example/bin/Debug_Ubuntu/websocket-sharp.dll and b/Example/bin/Debug_Ubuntu/websocket-sharp.dll differ diff --git a/Example/bin/Debug_Ubuntu/websocket-sharp.dll.mdb b/Example/bin/Debug_Ubuntu/websocket-sharp.dll.mdb index 1cd40672..0df8e7f1 100644 Binary files a/Example/bin/Debug_Ubuntu/websocket-sharp.dll.mdb and b/Example/bin/Debug_Ubuntu/websocket-sharp.dll.mdb differ diff --git a/Example/bin/Release/example.exe b/Example/bin/Release/example.exe index d0836323..9a35f423 100755 Binary files a/Example/bin/Release/example.exe and b/Example/bin/Release/example.exe differ diff --git a/Example/bin/Release/websocket-sharp.dll b/Example/bin/Release/websocket-sharp.dll index d9e3136c..e7fc10db 100755 Binary files a/Example/bin/Release/websocket-sharp.dll and b/Example/bin/Release/websocket-sharp.dll differ diff --git a/Example/bin/Release_Ubuntu/example.exe b/Example/bin/Release_Ubuntu/example.exe index 8e852069..6bb765ac 100755 Binary files a/Example/bin/Release_Ubuntu/example.exe and b/Example/bin/Release_Ubuntu/example.exe differ diff --git a/Example/bin/Release_Ubuntu/websocket-sharp.dll b/Example/bin/Release_Ubuntu/websocket-sharp.dll index 8525e1b8..760757ad 100755 Binary files a/Example/bin/Release_Ubuntu/websocket-sharp.dll and b/Example/bin/Release_Ubuntu/websocket-sharp.dll differ diff --git a/Example1/bin/Debug/example1.exe b/Example1/bin/Debug/example1.exe index 1e8aac75..a5302d49 100755 Binary files a/Example1/bin/Debug/example1.exe and b/Example1/bin/Debug/example1.exe differ diff --git a/Example1/bin/Debug/example1.exe.mdb b/Example1/bin/Debug/example1.exe.mdb index ad62a6df..8784f697 100644 Binary files a/Example1/bin/Debug/example1.exe.mdb and b/Example1/bin/Debug/example1.exe.mdb differ diff --git a/Example1/bin/Debug/websocket-sharp.dll b/Example1/bin/Debug/websocket-sharp.dll index b6615231..96bfd3f1 100755 Binary files a/Example1/bin/Debug/websocket-sharp.dll and b/Example1/bin/Debug/websocket-sharp.dll differ diff --git a/Example1/bin/Debug/websocket-sharp.dll.mdb b/Example1/bin/Debug/websocket-sharp.dll.mdb index 683cee97..76c6cfe0 100644 Binary files a/Example1/bin/Debug/websocket-sharp.dll.mdb and b/Example1/bin/Debug/websocket-sharp.dll.mdb differ diff --git a/Example1/bin/Debug_Ubuntu/example1.exe b/Example1/bin/Debug_Ubuntu/example1.exe index c6ee9fe5..1835a5dd 100755 Binary files a/Example1/bin/Debug_Ubuntu/example1.exe and b/Example1/bin/Debug_Ubuntu/example1.exe differ diff --git a/Example1/bin/Debug_Ubuntu/example1.exe.mdb b/Example1/bin/Debug_Ubuntu/example1.exe.mdb index 3c2c4b31..d2428513 100644 Binary files a/Example1/bin/Debug_Ubuntu/example1.exe.mdb and b/Example1/bin/Debug_Ubuntu/example1.exe.mdb differ diff --git a/Example1/bin/Debug_Ubuntu/websocket-sharp.dll b/Example1/bin/Debug_Ubuntu/websocket-sharp.dll index 8f734496..2b866264 100755 Binary files a/Example1/bin/Debug_Ubuntu/websocket-sharp.dll and b/Example1/bin/Debug_Ubuntu/websocket-sharp.dll differ diff --git a/Example1/bin/Debug_Ubuntu/websocket-sharp.dll.mdb b/Example1/bin/Debug_Ubuntu/websocket-sharp.dll.mdb index 1cd40672..0df8e7f1 100644 Binary files a/Example1/bin/Debug_Ubuntu/websocket-sharp.dll.mdb and b/Example1/bin/Debug_Ubuntu/websocket-sharp.dll.mdb differ diff --git a/Example1/bin/Release/example1.exe b/Example1/bin/Release/example1.exe index bdd16376..44b51c3a 100755 Binary files a/Example1/bin/Release/example1.exe and b/Example1/bin/Release/example1.exe differ diff --git a/Example1/bin/Release/websocket-sharp.dll b/Example1/bin/Release/websocket-sharp.dll index d9e3136c..e7fc10db 100755 Binary files a/Example1/bin/Release/websocket-sharp.dll and b/Example1/bin/Release/websocket-sharp.dll differ diff --git a/Example1/bin/Release_Ubuntu/example1.exe b/Example1/bin/Release_Ubuntu/example1.exe index ad23e938..98ed0a62 100755 Binary files a/Example1/bin/Release_Ubuntu/example1.exe and b/Example1/bin/Release_Ubuntu/example1.exe differ diff --git a/Example1/bin/Release_Ubuntu/websocket-sharp.dll b/Example1/bin/Release_Ubuntu/websocket-sharp.dll index 8525e1b8..760757ad 100755 Binary files a/Example1/bin/Release_Ubuntu/websocket-sharp.dll and b/Example1/bin/Release_Ubuntu/websocket-sharp.dll differ diff --git a/Example2/bin/Debug/example2.exe b/Example2/bin/Debug/example2.exe index 3ec5dc9a..3935f829 100755 Binary files a/Example2/bin/Debug/example2.exe and b/Example2/bin/Debug/example2.exe differ diff --git a/Example2/bin/Debug/example2.exe.mdb b/Example2/bin/Debug/example2.exe.mdb index db72cb61..7c082df5 100644 Binary files a/Example2/bin/Debug/example2.exe.mdb and b/Example2/bin/Debug/example2.exe.mdb differ diff --git a/Example2/bin/Debug/websocket-sharp.dll b/Example2/bin/Debug/websocket-sharp.dll index b6615231..96bfd3f1 100755 Binary files a/Example2/bin/Debug/websocket-sharp.dll and b/Example2/bin/Debug/websocket-sharp.dll differ diff --git a/Example2/bin/Debug/websocket-sharp.dll.mdb b/Example2/bin/Debug/websocket-sharp.dll.mdb index 683cee97..76c6cfe0 100644 Binary files a/Example2/bin/Debug/websocket-sharp.dll.mdb and b/Example2/bin/Debug/websocket-sharp.dll.mdb differ diff --git a/Example2/bin/Debug_Ubuntu/example2.exe b/Example2/bin/Debug_Ubuntu/example2.exe index f91dba1b..7bfa9a1a 100755 Binary files a/Example2/bin/Debug_Ubuntu/example2.exe and b/Example2/bin/Debug_Ubuntu/example2.exe differ diff --git a/Example2/bin/Debug_Ubuntu/example2.exe.mdb b/Example2/bin/Debug_Ubuntu/example2.exe.mdb index 620d38d5..ed291f11 100644 Binary files a/Example2/bin/Debug_Ubuntu/example2.exe.mdb and b/Example2/bin/Debug_Ubuntu/example2.exe.mdb differ diff --git a/Example2/bin/Debug_Ubuntu/websocket-sharp.dll b/Example2/bin/Debug_Ubuntu/websocket-sharp.dll index 8f734496..2b866264 100755 Binary files a/Example2/bin/Debug_Ubuntu/websocket-sharp.dll and b/Example2/bin/Debug_Ubuntu/websocket-sharp.dll differ diff --git a/Example2/bin/Debug_Ubuntu/websocket-sharp.dll.mdb b/Example2/bin/Debug_Ubuntu/websocket-sharp.dll.mdb index 1cd40672..0df8e7f1 100644 Binary files a/Example2/bin/Debug_Ubuntu/websocket-sharp.dll.mdb and b/Example2/bin/Debug_Ubuntu/websocket-sharp.dll.mdb differ diff --git a/Example2/bin/Release/example2.exe b/Example2/bin/Release/example2.exe index 83b86fbd..4fac76f9 100755 Binary files a/Example2/bin/Release/example2.exe and b/Example2/bin/Release/example2.exe differ diff --git a/Example2/bin/Release/websocket-sharp.dll b/Example2/bin/Release/websocket-sharp.dll index d9e3136c..e7fc10db 100755 Binary files a/Example2/bin/Release/websocket-sharp.dll and b/Example2/bin/Release/websocket-sharp.dll differ diff --git a/Example2/bin/Release_Ubuntu/example2.exe b/Example2/bin/Release_Ubuntu/example2.exe index f0b3fed3..a0194267 100755 Binary files a/Example2/bin/Release_Ubuntu/example2.exe and b/Example2/bin/Release_Ubuntu/example2.exe differ diff --git a/Example2/bin/Release_Ubuntu/websocket-sharp.dll b/Example2/bin/Release_Ubuntu/websocket-sharp.dll index 8525e1b8..760757ad 100755 Binary files a/Example2/bin/Release_Ubuntu/websocket-sharp.dll and b/Example2/bin/Release_Ubuntu/websocket-sharp.dll differ diff --git a/Example3/bin/Debug/Example3.exe b/Example3/bin/Debug/Example3.exe index adc0a4ac..225cac71 100755 Binary files a/Example3/bin/Debug/Example3.exe and b/Example3/bin/Debug/Example3.exe differ diff --git a/Example3/bin/Debug/Example3.exe.mdb b/Example3/bin/Debug/Example3.exe.mdb index fee38cdb..266e26d0 100644 Binary files a/Example3/bin/Debug/Example3.exe.mdb and b/Example3/bin/Debug/Example3.exe.mdb differ diff --git a/Example3/bin/Debug/websocket-sharp.dll b/Example3/bin/Debug/websocket-sharp.dll index b6615231..96bfd3f1 100755 Binary files a/Example3/bin/Debug/websocket-sharp.dll and b/Example3/bin/Debug/websocket-sharp.dll differ diff --git a/Example3/bin/Debug/websocket-sharp.dll.mdb b/Example3/bin/Debug/websocket-sharp.dll.mdb index 683cee97..76c6cfe0 100644 Binary files a/Example3/bin/Debug/websocket-sharp.dll.mdb and b/Example3/bin/Debug/websocket-sharp.dll.mdb differ diff --git a/Example3/bin/Debug_Ubuntu/Example3.exe b/Example3/bin/Debug_Ubuntu/Example3.exe index a0202ba3..b520c547 100755 Binary files a/Example3/bin/Debug_Ubuntu/Example3.exe and b/Example3/bin/Debug_Ubuntu/Example3.exe differ diff --git a/Example3/bin/Debug_Ubuntu/Example3.exe.mdb b/Example3/bin/Debug_Ubuntu/Example3.exe.mdb index 343365d7..2e6aa868 100644 Binary files a/Example3/bin/Debug_Ubuntu/Example3.exe.mdb and b/Example3/bin/Debug_Ubuntu/Example3.exe.mdb differ diff --git a/Example3/bin/Debug_Ubuntu/websocket-sharp.dll b/Example3/bin/Debug_Ubuntu/websocket-sharp.dll index 8f734496..2b866264 100755 Binary files a/Example3/bin/Debug_Ubuntu/websocket-sharp.dll and b/Example3/bin/Debug_Ubuntu/websocket-sharp.dll differ diff --git a/Example3/bin/Debug_Ubuntu/websocket-sharp.dll.mdb b/Example3/bin/Debug_Ubuntu/websocket-sharp.dll.mdb index 1cd40672..0df8e7f1 100644 Binary files a/Example3/bin/Debug_Ubuntu/websocket-sharp.dll.mdb and b/Example3/bin/Debug_Ubuntu/websocket-sharp.dll.mdb differ diff --git a/Example3/bin/Release/Example3.exe b/Example3/bin/Release/Example3.exe index 0fd18635..dabb5d91 100755 Binary files a/Example3/bin/Release/Example3.exe and b/Example3/bin/Release/Example3.exe differ diff --git a/Example3/bin/Release/websocket-sharp.dll b/Example3/bin/Release/websocket-sharp.dll index d9e3136c..e7fc10db 100755 Binary files a/Example3/bin/Release/websocket-sharp.dll and b/Example3/bin/Release/websocket-sharp.dll differ diff --git a/Example3/bin/Release_Ubuntu/Example3.exe b/Example3/bin/Release_Ubuntu/Example3.exe index 0be43a1b..9ac2fd85 100755 Binary files a/Example3/bin/Release_Ubuntu/Example3.exe and b/Example3/bin/Release_Ubuntu/Example3.exe differ diff --git a/Example3/bin/Release_Ubuntu/websocket-sharp.dll b/Example3/bin/Release_Ubuntu/websocket-sharp.dll index 8525e1b8..760757ad 100755 Binary files a/Example3/bin/Release_Ubuntu/websocket-sharp.dll and b/Example3/bin/Release_Ubuntu/websocket-sharp.dll differ diff --git a/websocket-sharp/Ext.cs b/websocket-sharp/Ext.cs index f62610ab..d415789b 100644 --- a/websocket-sharp/Ext.cs +++ b/websocket-sharp/Ext.cs @@ -458,6 +458,35 @@ namespace WebSocketSharp { return !(BitConverter.IsLittleEndian ^ (order == ByteOrder.LITTLE)); } + /// + /// Determines whether the specified represents a local IP address. + /// + /// + /// true if represents a local IP address; otherwise, false. + /// + /// + /// A to test. + /// + /// + /// is . + /// + public static bool IsLocal(this System.Net.IPAddress address) + { + if (address.IsNull()) + throw new ArgumentNullException("address"); + + if (System.Net.IPAddress.IsLoopback(address)) + return true; + + var host = System.Net.Dns.GetHostName(); + var addrs = System.Net.Dns.GetHostAddresses(host); + foreach (var addr in addrs) + if (address.Equals(addr)) + return true; + + return false; + } + /// /// Determines whether the specified object is . /// diff --git a/websocket-sharp/Net/HttpListenerRequest.cs b/websocket-sharp/Net/HttpListenerRequest.cs index a172dea2..d6e5d3e4 100644 --- a/websocket-sharp/Net/HttpListenerRequest.cs +++ b/websocket-sharp/Net/HttpListenerRequest.cs @@ -153,43 +153,46 @@ namespace WebSocketSharp.Net { } } - // TODO: Always returns false public bool IsAuthenticated { + // TODO: Always returns false get { return false; } } + /// + /// Gets a value indicating whether the request is sent from the local computer. + /// + /// + /// true if the request is sent from the local computer; otherwise, false. + /// public bool IsLocal { - get { return IPAddress.IsLoopback (RemoteEndPoint.Address); } + get { return RemoteEndPoint.Address.IsLocal(); } } public bool IsSecureConnection { get { return context.Connection.IsSecure; } } + /// + /// Gets a value indicating whether the request is a WebSocket connection request. + /// + /// + /// true if the request is a WebSocket connection request; otherwise, false. + /// public bool IsWebSocketRequest { get { - if (method != "GET") - return false; - - if (version != HttpVersion.Version11) - return false; - - if (!headers.Exists("Upgrade", "websocket")) - return false; - - if (!headers.Exists("Connection", "Upgrade")) - return false; - - if (!headers.Exists("Host")) - return false; - - if (!headers.Exists("Sec-WebSocket-Key")) - return false; - - if (!headers.Exists("Sec-WebSocket-Version")) - return false; - - return true; + return method != "GET" + ? false + : version != HttpVersion.Version11 + ? false + : !headers.Exists("Upgrade", "websocket") + ? false + : !headers.Exists("Connection", "Upgrade") + ? false + : !headers.Exists("Host") + ? false + : !headers.Exists("Sec-WebSocket-Key") + ? false + : headers.Exists("Sec-WebSocket-Version"); } } diff --git a/websocket-sharp/Net/WebSockets/HttpListenerWebSocketContext.cs b/websocket-sharp/Net/WebSockets/HttpListenerWebSocketContext.cs index e69ab0cf..852a896f 100644 --- a/websocket-sharp/Net/WebSockets/HttpListenerWebSocketContext.cs +++ b/websocket-sharp/Net/WebSockets/HttpListenerWebSocketContext.cs @@ -43,8 +43,8 @@ namespace WebSocketSharp.Net.WebSockets { #region Fields private HttpListenerContext _context; - private WebSocket _socket; - private WsStream _stream; + private WebSocket _websocket; + private WsStream _wsStream; #endregion @@ -52,24 +52,18 @@ namespace WebSocketSharp.Net.WebSockets { internal HttpListenerWebSocketContext(HttpListenerContext context) { - _context = context; - _stream = WsStream.CreateServerStream(context); - _socket = new WebSocket(this); + _context = context; + _wsStream = WsStream.CreateServerStream(context); + _websocket = new WebSocket(this); } #endregion - #region Internal Properties - - internal HttpListenerContext BaseContext { - get { - return _context; - } - } + #region Internal Property internal WsStream Stream { get { - return _stream; + return _wsStream; } } @@ -137,6 +131,22 @@ namespace WebSocketSharp.Net.WebSockets { } } + /// + /// Gets a value indicating whether the WebSocket connection request is valid. + /// + /// + /// true if the WebSocket connection request is valid; otherwise, false. + /// + public override bool IsValid { + get { + return !_context.Request.IsWebSocketRequest + ? false + : SecWebSocketKey.IsNullOrEmpty() + ? false + : !SecWebSocketVersion.IsNullOrEmpty(); + } + } + /// /// Gets the value of the Origin header field used in the WebSocket opening handshake. /// @@ -161,6 +171,18 @@ namespace WebSocketSharp.Net.WebSockets { } } + /// + /// Gets the collection of query string variables used in the WebSocket opening handshake. + /// + /// + /// A that contains the collection of query string variables. + /// + public override NameValueCollection QueryString { + get { + return _context.Request.QueryString; + } + } + /// /// Gets the WebSocket URI requested by the client. /// @@ -262,10 +284,19 @@ namespace WebSocketSharp.Net.WebSockets { /// public override WebSocket WebSocket { get { - return _socket; + return _websocket; } } #endregion + + #region Internal Method + + internal void Close() + { + _context.Connection.Close(true); + } + + #endregion } } diff --git a/websocket-sharp/Net/WebSockets/TcpListenerWebSocketContext.cs b/websocket-sharp/Net/WebSockets/TcpListenerWebSocketContext.cs index acd0253f..ef7bf3fe 100644 --- a/websocket-sharp/Net/WebSockets/TcpListenerWebSocketContext.cs +++ b/websocket-sharp/Net/WebSockets/TcpListenerWebSocketContext.cs @@ -43,38 +43,32 @@ namespace WebSocketSharp.Net.WebSockets { { #region Fields - private TcpClient _client; + private TcpClient _tcpClient; private bool _isSecure; private RequestHandshake _request; - private WebSocket _socket; - private WsStream _stream; + private WebSocket _websocket; + private WsStream _wsStream; #endregion #region Constructor - internal TcpListenerWebSocketContext(TcpClient client, bool secure) + internal TcpListenerWebSocketContext(TcpClient tcpClient, bool secure) { - _client = client; - _isSecure = secure; - _stream = WsStream.CreateServerStream(client, secure); - _request = RequestHandshake.Parse(_stream.ReadHandshake()); - _socket = new WebSocket(this); + _tcpClient = tcpClient; + _isSecure = secure; + _wsStream = WsStream.CreateServerStream(tcpClient, secure); + _request = RequestHandshake.Parse(_wsStream.ReadHandshake()); + _websocket = new WebSocket(this); } #endregion #region Internal Properties - internal TcpClient Client { - get { - return _client; - } - } - internal WsStream Stream { get { - return _stream; + return _wsStream; } } @@ -130,12 +124,9 @@ namespace WebSocketSharp.Net.WebSockets { /// /// true if the client connected from the local computer; otherwise, false. /// - /// - /// This property is not implemented. - /// public override bool IsLocal { get { - throw new NotImplementedException(); + return UserEndPoint.Address.IsLocal(); } } @@ -151,6 +142,22 @@ namespace WebSocketSharp.Net.WebSockets { } } + /// + /// Gets a value indicating whether the WebSocket connection request is valid. + /// + /// + /// true if the WebSocket connection request is valid; otherwise, false. + /// + public override bool IsValid { + get { + return !_request.IsWebSocketRequest + ? false + : SecWebSocketKey.IsNullOrEmpty() + ? false + : !SecWebSocketVersion.IsNullOrEmpty(); + } + } + /// /// Gets the value of the Origin header field used in the WebSocket opening handshake. /// @@ -175,6 +182,18 @@ namespace WebSocketSharp.Net.WebSockets { } } + /// + /// Gets the collection of query string variables used in the WebSocket opening handshake. + /// + /// + /// A that contains the collection of query string variables. + /// + public override NameValueCollection QueryString { + get { + return _request.QueryString; + } + } + /// /// Gets the WebSocket URI requested by the client. /// @@ -240,7 +259,7 @@ namespace WebSocketSharp.Net.WebSockets { /// public virtual System.Net.IPEndPoint ServerEndPoint { get { - return (System.Net.IPEndPoint)_client.Client.LocalEndPoint; + return (System.Net.IPEndPoint)_tcpClient.Client.LocalEndPoint; } } @@ -267,7 +286,7 @@ namespace WebSocketSharp.Net.WebSockets { /// public virtual System.Net.IPEndPoint UserEndPoint { get { - return (System.Net.IPEndPoint)_client.Client.RemoteEndPoint; + return (System.Net.IPEndPoint)_tcpClient.Client.RemoteEndPoint; } } @@ -279,10 +298,20 @@ namespace WebSocketSharp.Net.WebSockets { /// public override WebSocket WebSocket { get { - return _socket; + return _websocket; } } #endregion + + #region Internal Method + + internal void Close() + { + _wsStream.Close(); + _tcpClient.Close(); + } + + #endregion } } diff --git a/websocket-sharp/Net/WebSockets/WebSocketContext.cs b/websocket-sharp/Net/WebSockets/WebSocketContext.cs index cd10c2e0..005039a6 100644 --- a/websocket-sharp/Net/WebSockets/WebSocketContext.cs +++ b/websocket-sharp/Net/WebSockets/WebSocketContext.cs @@ -94,6 +94,14 @@ namespace WebSocketSharp.Net.WebSockets { /// public abstract bool IsSecureConnection { get; } + /// + /// Gets a value indicating whether the WebSocket connection request is valid. + /// + /// + /// true if the WebSocket connection request is valid; otherwise, false. + /// + public abstract bool IsValid { get; } + /// /// Gets the value of the Origin header field used in the WebSocket opening handshake. /// @@ -102,6 +110,14 @@ namespace WebSocketSharp.Net.WebSockets { /// public abstract string Origin { get; } + /// + /// Gets the collection of query string variables used in the WebSocket opening handshake. + /// + /// + /// A that contains the collection of query string variables. + /// + public abstract NameValueCollection QueryString { get; } + /// /// Gets the WebSocket URI requested by the client. /// diff --git a/websocket-sharp/RequestHandshake.cs b/websocket-sharp/RequestHandshake.cs index cf2f3e88..f57080c9 100644 --- a/websocket-sharp/RequestHandshake.cs +++ b/websocket-sharp/RequestHandshake.cs @@ -68,30 +68,20 @@ namespace WebSocketSharp { public string HttpMethod { get; private set; } public bool IsWebSocketRequest { - get { - if (HttpMethod != "GET") - return false; - - if (ProtocolVersion != HttpVersion.Version11) - return false; - - if (!HeaderExists("Upgrade", "websocket")) - return false; - - if (!HeaderExists("Connection", "Upgrade")) - return false; - - if (!HeaderExists("Host")) - return false; - - if (!HeaderExists("Sec-WebSocket-Key")) - return false; - - if (!HeaderExists("Sec-WebSocket-Version")) - return false; - - return true; + return HttpMethod != "GET" + ? false + : ProtocolVersion != HttpVersion.Version11 + ? false + : !HeaderExists("Upgrade", "websocket") + ? false + : !HeaderExists("Connection", "Upgrade") + ? false + : !HeaderExists("Host") + ? false + : !HeaderExists("Sec-WebSocket-Key") + ? false + : HeaderExists("Sec-WebSocket-Version"); } } @@ -125,10 +115,9 @@ namespace WebSocketSharp { public string RawUrl { get { - if (RequestUri.IsAbsoluteUri) - return RequestUri.PathAndQuery; - - return RequestUri.OriginalString; + return RequestUri.IsAbsoluteUri + ? RequestUri.PathAndQuery + : RequestUri.OriginalString; } } diff --git a/websocket-sharp/Server/HttpServer.cs b/websocket-sharp/Server/HttpServer.cs index c90e084a..e090045c 100644 --- a/websocket-sharp/Server/HttpServer.cs +++ b/websocket-sharp/Server/HttpServer.cs @@ -353,7 +353,6 @@ namespace WebSocketSharp.Server { { var res = context.Response; var wsContext = context.AcceptWebSocket(); - var socket = wsContext.WebSocket; var path = wsContext.Path.UrlDecode(); IServiceHost svcHost; @@ -363,7 +362,7 @@ namespace WebSocketSharp.Server { return false; } - svcHost.BindWebSocket(socket); + svcHost.BindWebSocket(wsContext); return true; } diff --git a/websocket-sharp/Server/IServiceHost.cs b/websocket-sharp/Server/IServiceHost.cs index a30f5a67..11644f7b 100644 --- a/websocket-sharp/Server/IServiceHost.cs +++ b/websocket-sharp/Server/IServiceHost.cs @@ -27,11 +27,12 @@ #endregion using System; +using WebSocketSharp.Net.WebSockets; namespace WebSocketSharp.Server { /// - /// Exposes the methods and property for the WebSocket service host. + /// Exposes the methods and property for the host that provides a . /// /// /// @@ -46,12 +47,12 @@ namespace WebSocketSharp.Server { bool Sweeped { get; set; } /// - /// Binds the specified to the WebSocket service instance. + /// Binds the specified to a instance. /// - /// - /// A to bind. + /// + /// A that contains the WebSocket connection request objects to bind. /// - void BindWebSocket(WebSocket socket); + void BindWebSocket(WebSocketContext context); /// /// Broadcasts the specified to all service clients. diff --git a/websocket-sharp/Server/WebSocketServer.cs b/websocket-sharp/Server/WebSocketServer.cs index f4fbd60d..05d4797a 100644 --- a/websocket-sharp/Server/WebSocketServer.cs +++ b/websocket-sharp/Server/WebSocketServer.cs @@ -191,27 +191,27 @@ namespace WebSocketSharp.Server { #region Protected Method /// - /// Accepts a WebSocket connection. + /// Accepts a WebSocket connection request. /// /// /// A that contains the WebSocket connection request objects. /// protected override void AcceptWebSocket(TcpListenerWebSocketContext context) { - var socket = context.WebSocket; - var path = context.Path.UrlDecode(); + var websocket = context.WebSocket; + var path = context.Path.UrlDecode(); IServiceHost svcHost; if (!_svcHosts.TryGetServiceHost(path, out svcHost)) { - socket.Close(HttpStatusCode.NotImplemented); + websocket.Close(HttpStatusCode.NotImplemented); return; } if (BaseUri.IsAbsoluteUri) - socket.Url = new Uri(BaseUri, path); + websocket.Url = new Uri(BaseUri, path); - svcHost.BindWebSocket(socket); + svcHost.BindWebSocket(context); } #endregion diff --git a/websocket-sharp/Server/WebSocketServerBase.cs b/websocket-sharp/Server/WebSocketServerBase.cs index c1a654a3..b61a1b2a 100644 --- a/websocket-sharp/Server/WebSocketServerBase.cs +++ b/websocket-sharp/Server/WebSocketServerBase.cs @@ -336,7 +336,7 @@ namespace WebSocketSharp.Server { #region Protected Methods /// - /// Accepts a WebSocket connection. + /// Accepts a WebSocket connection request. /// /// /// A that contains the WebSocket connection request objects. diff --git a/websocket-sharp/Server/WebSocketService.cs b/websocket-sharp/Server/WebSocketService.cs index d02a8e12..0b66d0a8 100644 --- a/websocket-sharp/Server/WebSocketService.cs +++ b/websocket-sharp/Server/WebSocketService.cs @@ -30,6 +30,7 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Threading; +using WebSocketSharp.Net.WebSockets; namespace WebSocketSharp.Server { @@ -43,8 +44,9 @@ namespace WebSocketSharp.Server { #region Private Fields + private WebSocketContext _context; private WebSocketServiceManager _sessions; - private WebSocket _socket; + private WebSocket _websocket; #endregion @@ -64,26 +66,30 @@ namespace WebSocketSharp.Server { #region Protected Properties /// - /// Gets the HTTP query string variables used in the WebSocket opening handshake. + /// Gets the collection of query string variables used in the WebSocket opening handshake. /// /// - /// A that contains the query string variables. + /// A that contains the collection of query string variables. /// protected NameValueCollection QueryString { get { - return IsBound ? _socket.QueryString : null; + return IsBound + ? _context.QueryString + : null; } } /// - /// Gets the sessions to the WebSocket service. + /// Gets the sessions to the . /// /// - /// A that contains the sessions to the WebSocket service. + /// A that contains the sessions to the the . /// protected WebSocketServiceManager Sessions { get { - return IsBound ? _sessions : null; + return IsBound + ? _sessions + : null; } } @@ -137,30 +143,31 @@ namespace WebSocketSharp.Server { #region Internal Methods - internal void Bind(WebSocket socket, WebSocketServiceManager sessions) + internal void Bind(WebSocketContext context, WebSocketServiceManager sessions) { if (IsBound) return; - _socket = socket; - _sessions = sessions; + _context = context; + _sessions = sessions; + _websocket = context.WebSocket; - _socket.OnOpen += onOpen; - _socket.OnMessage += onMessage; - _socket.OnError += onError; - _socket.OnClose += onClose; + _websocket.OnOpen += onOpen; + _websocket.OnMessage += onMessage; + _websocket.OnError += onError; + _websocket.OnClose += onClose; IsBound = true; } internal void SendAsync(byte[] data, Action completed) { - _socket.SendAsync(data, completed); + _websocket.SendAsync(data, completed); } internal void SendAsync(string data, Action completed) { - _socket.SendAsync(data, completed); + _websocket.SendAsync(data, completed); } #endregion @@ -288,7 +295,7 @@ namespace WebSocketSharp.Server { public bool Ping(string message) { return IsBound - ? _socket.Ping(message) + ? _websocket.Ping(message) : false; } @@ -340,7 +347,7 @@ namespace WebSocketSharp.Server { public void Send(byte[] data) { if (IsBound) - _socket.Send(data); + _websocket.Send(data); } /// @@ -352,7 +359,7 @@ namespace WebSocketSharp.Server { public void Send(string data) { if (IsBound) - _socket.Send(data); + _websocket.Send(data); } /// @@ -401,7 +408,7 @@ namespace WebSocketSharp.Server { public void Start() { if (IsBound) - _socket.Connect(); + _websocket.Connect(); } /// @@ -412,7 +419,7 @@ namespace WebSocketSharp.Server { if (!IsBound) return; - _socket.Close(); + _websocket.Close(); } /// @@ -429,7 +436,7 @@ namespace WebSocketSharp.Server { if (!IsBound) return; - _socket.Close(code, reason); + _websocket.Close(code, reason); } /// diff --git a/websocket-sharp/Server/WebSocketServiceHost.cs b/websocket-sharp/Server/WebSocketServiceHost.cs index 411d527e..bfe51d98 100644 --- a/websocket-sharp/Server/WebSocketServiceHost.cs +++ b/websocket-sharp/Server/WebSocketServiceHost.cs @@ -229,15 +229,15 @@ namespace WebSocketSharp.Server { #region Explicit Interface Implementation /// - /// Binds the specified to the WebSocket service instance. + /// Binds the specified to a instance. /// - /// - /// A to bind. + /// + /// A that contains the WebSocket connection request objects to bind. /// - void IServiceHost.BindWebSocket(WebSocket socket) + void IServiceHost.BindWebSocket(WebSocketContext context) { T service = new T(); - service.Bind(socket, _sessions); + service.Bind(context, _sessions); service.Start(); } @@ -246,25 +246,25 @@ namespace WebSocketSharp.Server { #region Protected Method /// - /// Accepts a WebSocket connection. + /// Accepts a WebSocket connection request. /// /// /// A that contains the WebSocket connection request objects. /// protected override void AcceptWebSocket(TcpListenerWebSocketContext context) { - var socket = context.WebSocket; - var path = context.Path.UrlDecode(); + var websocket = context.WebSocket; + var path = context.Path.UrlDecode(); if (path != Uri.GetAbsolutePath().UrlDecode()) { - socket.Close(HttpStatusCode.NotImplemented); + websocket.Close(HttpStatusCode.NotImplemented); return; } if (Uri.IsAbsoluteUri) - socket.Url = Uri; + websocket.Url = Uri; - ((IServiceHost)this).BindWebSocket(socket); + ((IServiceHost)this).BindWebSocket(context); } #endregion diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index ea077cca..f1c6b8d1 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -64,24 +64,22 @@ namespace WebSocketSharp { #region Private Fields - private string _base64key; - private HttpListenerContext _httpContext; - private WebSocketContext _context; - private System.Net.IPEndPoint _endPoint; - private string _extensions; - private AutoResetEvent _exitMessageLoop; - private Object _forClose; - private Object _forSend; - private bool _isClient; - private bool _isSecure; - private string _protocol; - private string _protocols; - private NameValueCollection _queryString; - private volatile WsState _readyState; - private AutoResetEvent _receivePong; - private TcpClient _tcpClient; - private Uri _uri; - private WsStream _wsStream; + private string _base64key; + private Action _closeContext; + private WebSocketContext _context; + private string _extensions; + private AutoResetEvent _exitMessageLoop; + private Object _forClose; + private Object _forSend; + private bool _isClient; + private bool _isSecure; + private string _protocol; + private string _protocols; + private volatile WsState _readyState; + private AutoResetEvent _receivePong; + private TcpClient _tcpClient; + private Uri _uri; + private WsStream _wsStream; #endregion @@ -103,25 +101,17 @@ namespace WebSocketSharp { internal WebSocket(HttpListenerWebSocketContext context) : this() { - _uri = context.Path.ToUri(); - _context = context; - _httpContext = context.BaseContext; - _wsStream = context.Stream; - _endPoint = context.ServerEndPoint; - _isClient = false; - _isSecure = context.IsSecureConnection; + _wsStream = context.Stream; + _closeContext = () => context.Close(); + init(context); } internal WebSocket(TcpListenerWebSocketContext context) : this() { - _uri = context.Path.ToUri(); - _context = context; - _tcpClient = context.Client; - _wsStream = context.Stream; - _endPoint = context.ServerEndPoint; - _isClient = false; - _isSecure = context.IsSecureConnection; + _wsStream = context.Stream; + _closeContext = () => context.Close(); + init(context); } #endregion @@ -207,16 +197,6 @@ namespace WebSocketSharp { #endregion - #region Internal Property - - internal NameValueCollection QueryString { - get { - return _queryString; - } - } - - #endregion - #region Public Properties /// @@ -292,6 +272,7 @@ namespace WebSocketSharp { get { return _uri; } + internal set { if (_readyState == WsState.CONNECTING && !_isClient) _uri = value; @@ -329,15 +310,8 @@ namespace WebSocketSharp { // As Server private void acceptHandshake() { - var req = receiveOpeningHandshake(); - - string msg; - if (!isValidRequest(req, out msg)) - { - onError(msg); - close(CloseStatusCode.ABNORMAL, msg); + if (!receiveOpeningHandshake()) return; - } sendResponseHandshake(); onOpen(); @@ -363,7 +337,7 @@ namespace WebSocketSharp { return; sendResponseHandshake(code); - closeConnection(); + closeResources(); } private void close(PayloadData data) @@ -428,30 +402,24 @@ namespace WebSocketSharp { close(payloadData); } - private bool closeConnection() + private void closeHandshake(PayloadData data) + { + var args = new CloseEventArgs(data); + var frame = createFrame(Fin.FINAL, Opcode.CLOSE, data); + send(frame); + onClose(args); + } + + private bool closeResources() { _readyState = WsState.CLOSED; try { - if (!_httpContext.IsNull()) - { - _httpContext.Response.Close(); - _wsStream = null; - _httpContext = null; - } - - if (!_wsStream.IsNull()) - { - _wsStream.Dispose(); - _wsStream = null; - } - - if (!_tcpClient.IsNull()) - { - _tcpClient.Close(); - _tcpClient = null; - } + if (_isClient) + closeResourcesAsClient(); + else + closeResourcesAsServer(); return true; } @@ -462,12 +430,31 @@ namespace WebSocketSharp { } } - private void closeHandshake(PayloadData data) + // As Client + private void closeResourcesAsClient() { - var args = new CloseEventArgs(data); - var frame = createFrame(Fin.FINAL, Opcode.CLOSE, data); - send(frame); - onClose(args); + if (!_wsStream.IsNull()) + { + _wsStream.Dispose(); + _wsStream = null; + } + + if (!_tcpClient.IsNull()) + { + _tcpClient.Close(); + _tcpClient = null; + } + } + + // As Server + private void closeResourcesAsServer() + { + if (!_context.IsNull() && !_closeContext.IsNull()) + { + _closeContext(); + _wsStream = null; + _context = null; + } } // As Client @@ -539,9 +526,9 @@ namespace WebSocketSharp { private string createResponseKey() { SHA1 sha1 = new SHA1CryptoServiceProvider(); - var sb = new StringBuilder(_base64key); + var sb = new StringBuilder(_base64key); sb.Append(_guid); - var src = sha1.ComputeHash(Encoding.UTF8.GetBytes(sb.ToString())); + var src = sha1.ComputeHash(Encoding.UTF8.GetBytes(sb.ToString())); return Convert.ToBase64String(src); } @@ -562,6 +549,16 @@ namespace WebSocketSharp { onOpen(); } + // As Server + private void init(WebSocketContext context) + { + _context = context; + _isSecure = context.IsSecureConnection; + + _uri = "/".ToUri(); + _isClient = false; + } + private bool isValidCloseStatusCode(ushort code, out string message) { if (code < 1000) @@ -594,65 +591,33 @@ namespace WebSocketSharp { } // As Server - private bool isValidRequest(RequestHandshake request, out string message) + private bool isValidRequest() { - if (!request.IsWebSocketRequest) - { - message = "Invalid WebSocket request."; - return false; - } - - if (_uri.IsAbsoluteUri && !isValidRequestHost(request.Headers["Host"], out message)) - return false; - - if (!request.HeaderExists("Sec-WebSocket-Version", _version)) - { - message = "Unsupported Sec-WebSocket-Version."; - return false; - } - - _base64key = request.Headers["Sec-WebSocket-Key"]; - - if (request.HeaderExists("Sec-WebSocket-Protocol")) - _protocols = request.Headers["Sec-WebSocket-Protocol"]; - - if (request.HeaderExists("Sec-WebSocket-Extensions")) - _extensions = request.Headers["Sec-WebSocket-Extensions"]; - - _queryString = request.QueryString; - - message = String.Empty; - return true; + return !_context.IsValid + ? false + : !isValidRequestHostHeader() + ? false + : _context.Headers.Exists("Sec-WebSocket-Version", _version); } // As Server - private bool isValidRequestHost(string value, out string message) + private bool isValidRequestHostHeader() { - var host = _uri.DnsSafeHost; - var type = Uri.CheckHostName(host); - var address = _endPoint.Address; - var port = _endPoint.Port; - - var expectedHost1 = host; - var expectedHost2 = type == UriHostNameType.Dns - ? address.ToString() - : System.Net.Dns.GetHostEntry(address).HostName; - - if (port != 80) - { - expectedHost1 += ":" + port; - expectedHost2 += ":" + port; - } + var authority = _context.Headers["Host"]; + if (authority.IsNullOrEmpty() || !_uri.IsAbsoluteUri) + return true; - if (expectedHost1.NotEqual(value, false) && - expectedHost2.NotEqual(value, false)) - { - message = "Invalid Host."; - return false; - } + var i = authority.IndexOf(':'); + var host = i > 0 + ? authority.Substring(0, i) + : authority; + var type = Uri.CheckHostName(host); - message = String.Empty; - return true; + return type != UriHostNameType.Dns + ? true + : Uri.CheckHostName(_uri.DnsSafeHost) != UriHostNameType.Dns + ? true + : host == _uri.DnsSafeHost; } // As Client @@ -693,7 +658,7 @@ namespace WebSocketSharp { if (!_exitMessageLoop.IsNull()) _exitMessageLoop.WaitOne(5 * 1000); - if (closeConnection()) + if (closeResources()) eventArgs.WasClean = true; OnClose.Emit(this, eventArgs); @@ -879,14 +844,28 @@ namespace WebSocketSharp { } // As Server - private RequestHandshake receiveOpeningHandshake() + private bool receiveOpeningHandshake() { - var req = RequestHandshake.Parse(_context); #if DEBUG + var req = RequestHandshake.Parse(_context); Console.WriteLine("WS: Info@receiveOpeningHandshake: Opening handshake from client:\n"); Console.WriteLine(req.ToString()); #endif - return req; + if (!isValidRequest()) + { + onError("Invalid WebSocket connection request."); + close(HttpStatusCode.BadRequest); + return false; + } + + _base64key = _context.SecWebSocketKey; + if (_context.Headers.Exists("Sec-WebSocket-Protocol")) + _protocols = _context.Headers["Sec-WebSocket-Protocol"]; + + if (_context.Headers.Exists("Sec-WebSocket-Extensions")) + _extensions = _context.Headers["Sec-WebSocket-Extensions"]; + + return true; } // As Client diff --git a/websocket-sharp/bin/Debug/websocket-sharp.dll b/websocket-sharp/bin/Debug/websocket-sharp.dll index b6615231..96bfd3f1 100755 Binary files a/websocket-sharp/bin/Debug/websocket-sharp.dll and b/websocket-sharp/bin/Debug/websocket-sharp.dll differ diff --git a/websocket-sharp/bin/Debug/websocket-sharp.dll.mdb b/websocket-sharp/bin/Debug/websocket-sharp.dll.mdb index 683cee97..76c6cfe0 100644 Binary files a/websocket-sharp/bin/Debug/websocket-sharp.dll.mdb and b/websocket-sharp/bin/Debug/websocket-sharp.dll.mdb differ diff --git a/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll b/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll index ada75c22..2b866264 100755 Binary files a/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll and b/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll differ diff --git a/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll.mdb b/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll.mdb index 7cc96a4b..0df8e7f1 100644 Binary files a/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll.mdb and b/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll.mdb differ diff --git a/websocket-sharp/bin/Release/websocket-sharp.dll b/websocket-sharp/bin/Release/websocket-sharp.dll index d9e3136c..e7fc10db 100755 Binary files a/websocket-sharp/bin/Release/websocket-sharp.dll and b/websocket-sharp/bin/Release/websocket-sharp.dll differ diff --git a/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.dll b/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.dll index 48e4cc15..760757ad 100755 Binary files a/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.dll and b/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.dll differ diff --git a/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.xml b/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.xml index a18fc062..b570b7aa 100644 --- a/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.xml +++ b/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.xml @@ -223,6 +223,20 @@ A to test. + + + Determines whether the specified represents a local IP address. + + + true if represents a local IP address; otherwise, false. + + + A to test. + + + is . + + Determines whether the specified object is . @@ -1131,7 +1145,7 @@ - Accepts a WebSocket connection. + Accepts a WebSocket connection request. A that contains the WebSocket connection request objects. @@ -1176,18 +1190,18 @@ - Gets the HTTP query string variables used in the WebSocket opening handshake. + Gets the collection of query string variables used in the WebSocket opening handshake. - A that contains the query string variables. + A that contains the collection of query string variables. - Gets the sessions to the WebSocket service. + Gets the sessions to the . - A that contains the sessions to the WebSocket service. + A that contains the sessions to the the . @@ -1817,6 +1831,22 @@ The associated with this is closed. + + + Gets a value indicating whether the request is sent from the local computer. + + + true if the request is sent from the local computer; otherwise, false. + + + + + Gets a value indicating whether the request is a WebSocket connection request. + + + true if the request is a WebSocket connection request; otherwise, false. + + Decodes an HTML-encoded string and returns the decoded string. @@ -2444,7 +2474,7 @@ - Accepts a WebSocket connection. + Accepts a WebSocket connection request. A that contains the WebSocket connection request objects. @@ -2470,7 +2500,7 @@ - Exposes the methods and property for the WebSocket service host. + Exposes the methods and property for the host that provides a . @@ -2483,12 +2513,12 @@ true if the WebSocket service host cleans up the inactive service clients periodically; otherwise, false. - + - Binds the specified to the WebSocket service instance. + Binds the specified to a instance. - - A to bind. + + A that contains the WebSocket connection request objects to bind. @@ -2627,17 +2657,17 @@ A that contains a WebSocket URL. - + - Binds the specified to the WebSocket service instance. + Binds the specified to a instance. - - A to bind. + + A that contains the WebSocket connection request objects to bind. - Accepts a WebSocket connection. + Accepts a WebSocket connection request. A that contains the WebSocket connection request objects. @@ -2844,6 +2874,14 @@ true if the WebSocket connection is secured; otherwise, false. + + + Gets a value indicating whether the WebSocket connection request is valid. + + + true if the WebSocket connection request is valid; otherwise, false. + + Gets the value of the Origin header field used in the WebSocket opening handshake. @@ -2860,6 +2898,14 @@ A that contains the absolute path. + + + Gets the collection of query string variables used in the WebSocket opening handshake. + + + A that contains the collection of query string variables. + + Gets the WebSocket URI requested by the client. @@ -2977,9 +3023,6 @@ true if the client connected from the local computer; otherwise, false. - - This property is not implemented. - @@ -2989,6 +3032,14 @@ true if the WebSocket connection is secured; otherwise, false. + + + Gets a value indicating whether the WebSocket connection request is valid. + + + true if the WebSocket connection request is valid; otherwise, false. + + Gets the value of the Origin header field used in the WebSocket opening handshake. @@ -3005,6 +3056,14 @@ A that contains the absolute path. + + + Gets the collection of query string variables used in the WebSocket opening handshake. + + + A that contains the collection of query string variables. + + Gets the WebSocket URI requested by the client. @@ -3134,6 +3193,14 @@ true if the WebSocket connection is secured; otherwise, false. + + + Gets a value indicating whether the WebSocket connection request is valid. + + + true if the WebSocket connection request is valid; otherwise, false. + + Gets the value of the Origin header field used in the WebSocket opening handshake. @@ -3142,6 +3209,14 @@ A that contains the value of the Origin header field. + + + Gets the collection of query string variables used in the WebSocket opening handshake. + + + A that contains the collection of query string variables. + + Gets the WebSocket URI requested by the client. diff --git a/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/HttpListenerWebSocketContext.html b/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/HttpListenerWebSocketContext.html index 4a49f40a..7e189a19 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/HttpListenerWebSocketContext.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/HttpListenerWebSocketContext.html @@ -368,6 +368,34 @@ bool . Gets a value indicating whether the WebSocket connection is secured. + (Inherited from WebSocketContext.) + + + [read-only]
override
+ + + IsValid + + + + + bool + . + Gets a value indicating whether the WebSocket connection request is valid. + + + + [read-only]
abstract
+ + + IsValid + + + + + bool + . + Gets a value indicating whether the WebSocket connection request is valid. (Inherited from WebSocketContext.) @@ -411,6 +439,34 @@ . Gets the absolute path of the requested WebSocket URI. + + + [read-only]
override
+ + + QueryString + + + + + System.Collections.Specialized.NameValueCollection + . + Gets the collection of query string variables used in the WebSocket opening handshake. + + + + [read-only]
abstract
+ + + QueryString + + + + + System.Collections.Specialized.NameValueCollection + . + Gets the collection of query string variables used in the WebSocket opening handshake. + (Inherited from WebSocketContext.) [read-only]
override
@@ -746,6 +802,26 @@ Namespace: WebSocketSharp.Net.WebSockets
Assembly: websocket-sharp (in websocket-sharp.dll)
+

IsValid Property

+
+

+ Gets a value indicating whether the WebSocket connection request is valid. +

+

Syntax

+
public override bool IsValid { get; }
+

Value

+
+ true if the WebSocket connection request is valid; otherwise, false. +
+

Remarks

+
+ Documentation for this section has not yet been entered. +
+

Requirements

+
+ Namespace: WebSocketSharp.Net.WebSockets
Assembly: websocket-sharp (in websocket-sharp.dll)
+
+

Origin Property

@@ -786,6 +862,26 @@ Namespace: WebSocketSharp.Net.WebSockets
Assembly: websocket-sharp (in websocket-sharp.dll)


+

QueryString Property

+
+

+ Gets the collection of query string variables used in the WebSocket opening handshake. +

+

Syntax

+
public override System.Collections.Specialized.NameValueCollection QueryString { get; }
+

Value

+
+ A System.Collections.Specialized.NameValueCollection that contains the collection of query string variables. +
+

Remarks

+
+ Documentation for this section has not yet been entered. +
+

Requirements

+
+ Namespace: WebSocketSharp.Net.WebSockets
Assembly: websocket-sharp (in websocket-sharp.dll)
+
+

RequestUri Property

diff --git a/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/TcpListenerWebSocketContext.html b/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/TcpListenerWebSocketContext.html index 4e1aac40..26720b66 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/TcpListenerWebSocketContext.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/TcpListenerWebSocketContext.html @@ -368,6 +368,34 @@ bool . Gets a value indicating whether the WebSocket connection is secured. + (Inherited from WebSocketContext.) + + + [read-only]

override
+ + + IsValid + + + + + bool + . + Gets a value indicating whether the WebSocket connection request is valid. + + + + [read-only]
abstract
+ + + IsValid + + + + + bool + . + Gets a value indicating whether the WebSocket connection request is valid. (Inherited from WebSocketContext.) @@ -411,6 +439,34 @@ . Gets the absolute path of the requested WebSocket URI. + + + [read-only]
override
+ + + QueryString + + + + + System.Collections.Specialized.NameValueCollection + . + Gets the collection of query string variables used in the WebSocket opening handshake. + + + + [read-only]
abstract
+ + + QueryString + + + + + System.Collections.Specialized.NameValueCollection + . + Gets the collection of query string variables used in the WebSocket opening handshake. + (Inherited from WebSocketContext.) [read-only]
override
@@ -797,6 +853,26 @@ Namespace: WebSocketSharp.Net.WebSockets
Assembly: websocket-sharp (in websocket-sharp.dll)
+

IsValid Property

+
+

+ Gets a value indicating whether the WebSocket connection request is valid. +

+

Syntax

+
public override bool IsValid { get; }
+

Value

+
+ true if the WebSocket connection request is valid; otherwise, false. +
+

Remarks

+
+ Documentation for this section has not yet been entered. +
+

Requirements

+
+ Namespace: WebSocketSharp.Net.WebSockets
Assembly: websocket-sharp (in websocket-sharp.dll)
+
+

Origin Property

@@ -837,6 +913,26 @@ Namespace: WebSocketSharp.Net.WebSockets
Assembly: websocket-sharp (in websocket-sharp.dll)


+

QueryString Property

+
+

+ Gets the collection of query string variables used in the WebSocket opening handshake. +

+

Syntax

+
public override System.Collections.Specialized.NameValueCollection QueryString { get; }
+

Value

+
+ A System.Collections.Specialized.NameValueCollection that contains the collection of query string variables. +
+

Remarks

+
+ Documentation for this section has not yet been entered. +
+

Requirements

+
+ Namespace: WebSocketSharp.Net.WebSockets
Assembly: websocket-sharp (in websocket-sharp.dll)
+
+

RequestUri Property

diff --git a/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/WebSocketContext.html b/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/WebSocketContext.html index ef9ea6db..82d6ab3d 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/WebSocketContext.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/WebSocketContext.html @@ -321,6 +321,20 @@ bool . Gets a value indicating whether the WebSocket connection is secured. + + + + [read-only]

abstract
+ + + IsValid + + + + + bool + . + Gets a value indicating whether the WebSocket connection request is valid. @@ -335,6 +349,20 @@ string . Gets the value of the Origin header field used in the WebSocket opening handshake. + + + + [read-only]
abstract
+ + + QueryString + + + + + System.Collections.Specialized.NameValueCollection + . + Gets the collection of query string variables used in the WebSocket opening handshake. @@ -575,6 +603,26 @@ Namespace: WebSocketSharp.Net.WebSockets
Assembly: websocket-sharp (in websocket-sharp.dll)
+

IsValid Property

+
+

+ Gets a value indicating whether the WebSocket connection request is valid. +

+

Syntax

+
public abstract bool IsValid { get; }
+

Value

+
+ true if the WebSocket connection request is valid; otherwise, false. +
+

Remarks

+
+ Documentation for this section has not yet been entered. +
+

Requirements

+
+ Namespace: WebSocketSharp.Net.WebSockets
Assembly: websocket-sharp (in websocket-sharp.dll)
+
+

Origin Property

@@ -595,6 +643,26 @@ Namespace: WebSocketSharp.Net.WebSockets
Assembly: websocket-sharp (in websocket-sharp.dll)


+

QueryString Property

+
+

+ Gets the collection of query string variables used in the WebSocket opening handshake. +

+

Syntax

+
public abstract System.Collections.Specialized.NameValueCollection QueryString { get; }
+

Value

+
+ A System.Collections.Specialized.NameValueCollection that contains the collection of query string variables. +
+

Remarks

+
+ Documentation for this section has not yet been entered. +
+

Requirements

+
+ Namespace: WebSocketSharp.Net.WebSockets
Assembly: websocket-sharp (in websocket-sharp.dll)
+
+

RequestUri Property

diff --git a/websocket-sharp/doc/html/WebSocketSharp.Net/HttpListenerRequest.html b/websocket-sharp/doc/html/WebSocketSharp.Net/HttpListenerRequest.html index 2fcfe22a..70b691fb 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Net/HttpListenerRequest.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Net/HttpListenerRequest.html @@ -372,7 +372,9 @@ bool - . Documentation for this section has not yet been entered. + . + Gets a value indicating whether the request is sent from the local computer. + [read-only]

@@ -396,7 +398,9 @@ bool - . Documentation for this section has not yet been entered. + . + Gets a value indicating whether the request is a WebSocket connection request. + [read-only]
@@ -618,6 +622,18 @@ (this T, Action) : bool
Determines whether the specified object is null. And invokes the specified Action delegate if the specified object is null. +
+ + + +
static
+ + + + IsUpgradeTo + (this HttpListenerRequest, string) : bool
+ Determines whether the specified WebSocketSharp.Net.HttpListenerRequest is the HTTP Upgrade request + to switch to the specified protocol.
@@ -939,14 +955,14 @@

IsLocal Property

- Documentation for this section has not yet been entered. -

+ Gets a value indicating whether the request is sent from the local computer. +

Syntax

public bool IsLocal { get; }

Value

- Documentation for this section has not yet been entered. -
+ true if the request is sent from the local computer; otherwise, false. +

Remarks

Documentation for this section has not yet been entered. @@ -979,14 +995,14 @@

IsWebSocketRequest Property

- Documentation for this section has not yet been entered. -

+ Gets a value indicating whether the request is a WebSocket connection request. +

Syntax

public bool IsWebSocketRequest { get; }

Value

- Documentation for this section has not yet been entered. -
+ true if the request is a WebSocket connection request; otherwise, false. +

Remarks

Documentation for this section has not yet been entered. diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/IServiceHost.html b/websocket-sharp/doc/html/WebSocketSharp.Server/IServiceHost.html index 59bdc8fe..4575d583 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/IServiceHost.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/IServiceHost.html @@ -207,7 +207,7 @@

IServiceHost Interface

- Exposes the methods and property for the WebSocket service host. + Exposes the methods and property for the host that provides a WebSocketSharp.Server.WebSocketService.

Syntax

@@ -257,9 +257,9 @@ - BindWebSocket - (WebSocketSharp.WebSocket)
- Binds the specified WebSocketSharp.WebSocket to the WebSocket service instance. + BindWebSocket + (WebSocketSharp.Net.WebSockets.WebSocketContext)
+ Binds the specified WebSocketSharp.Net.WebSockets.WebSocketContext to a WebSocketSharp.Server.WebSocketService instance.
@@ -336,30 +336,30 @@

Member Details

-

BindWebSocket Method

-
+

BindWebSocket Method

+

- Binds the specified WebSocketSharp.WebSocket to the WebSocket service instance. + Binds the specified WebSocketSharp.Net.WebSockets.WebSocketContext to a WebSocketSharp.Server.WebSocketService instance.

Syntax

-
public void BindWebSocket (WebSocketSharp.WebSocket socket)
+

Parameters

-
+
- socket + context
- A WebSocketSharp.WebSocket to bind. + A WebSocketSharp.Net.WebSockets.WebSocketContext that contains the WebSocket connection request objects to bind.

Remarks

-
+
Documentation for this section has not yet been entered.

Requirements

-
+
Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServer.html b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServer.html index 339a2746..f115c0f8 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServer.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServer.html @@ -525,7 +525,7 @@ AcceptWebSocket (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext)
- Accepts a WebSocket connection. + Accepts a WebSocket connection request.
@@ -536,7 +536,7 @@ AcceptWebSocket (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext)
- Accepts a WebSocket connection. + Accepts a WebSocket connection request. (Inherited from WebSocketServerBase.)
@@ -793,7 +793,7 @@

AcceptWebSocket Method

- Accepts a WebSocket connection. + Accepts a WebSocket connection request.

Syntax

protected override void AcceptWebSocket (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext context)
diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServerBase.html b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServerBase.html index f2bfcf86..ad667e68 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServerBase.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServerBase.html @@ -411,7 +411,7 @@ AcceptWebSocket (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext)
- Accepts a WebSocket connection. + Accepts a WebSocket connection request.
@@ -636,7 +636,7 @@

AcceptWebSocket Method

- Accepts a WebSocket connection. + Accepts a WebSocket connection request.

Syntax

protected abstract void AcceptWebSocket (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext context)
diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketService.html b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketService.html index aac17ad9..9d04ffb4 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketService.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketService.html @@ -299,7 +299,7 @@ System.Collections.Specialized.NameValueCollection . - Gets the HTTP query string variables used in the WebSocket opening handshake. + Gets the collection of query string variables used in the WebSocket opening handshake. @@ -313,7 +313,7 @@ WebSocketServiceManager . - Gets the sessions to the WebSocket service. + Gets the sessions to the WebSocketSharp.Server.WebSocketService. @@ -1004,13 +1004,13 @@

QueryString Property

- Gets the HTTP query string variables used in the WebSocket opening handshake. + Gets the collection of query string variables used in the WebSocket opening handshake.

Syntax

Value

- A System.Collections.Specialized.NameValueCollection that contains the query string variables. + A System.Collections.Specialized.NameValueCollection that contains the collection of query string variables.

Remarks

@@ -1146,13 +1146,13 @@

Sessions Property

- Gets the sessions to the WebSocket service. + Gets the sessions to the WebSocketSharp.Server.WebSocketService.

Syntax

protected WebSocketServiceManager Sessions { get; }

Value

- A WebSocketSharp.Server.WebSocketServiceManager that contains the sessions to the WebSocket service. + A WebSocketSharp.Server.WebSocketServiceManager that contains the sessions to the the WebSocketSharp.Server.WebSocketService.

Remarks

diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceHost`1.html b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceHost`1.html index bc12bd36..165e3c97 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceHost`1.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceHost`1.html @@ -553,7 +553,7 @@ AcceptWebSocket (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext)
- Accepts a WebSocket connection. + Accepts a WebSocket connection request.
@@ -564,7 +564,7 @@ AcceptWebSocket (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext)
- Accepts a WebSocket connection. + Accepts a WebSocket connection request. (Inherited from WebSocketServerBase.)
@@ -613,12 +613,12 @@
- + WebSocketSharp.Server.IServiceHost.BindWebSocket - Binds the specified WebSocketSharp.WebSocket to the WebSocket service instance. + Binds the specified WebSocketSharp.Net.WebSockets.WebSocketContext to a WebSocketSharp.Server.WebSocketService instance. @@ -912,7 +912,7 @@

AcceptWebSocket Method

- Accepts a WebSocket connection. + Accepts a WebSocket connection request.

Syntax

protected override void AcceptWebSocket (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext context)
@@ -1052,31 +1052,31 @@ Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

-

WebSocketSharp.Server.IServiceHost.BindWebSocket Method

-
+

WebSocketSharp.Server.IServiceHost.BindWebSocket Method

+

- Binds the specified WebSocketSharp.WebSocket to the WebSocket service instance. + Binds the specified WebSocketSharp.Net.WebSockets.WebSocketContext to a WebSocketSharp.Server.WebSocketService instance.

Syntax

- void WebSocketSharp.Server.IServiceHost.BindWebSocket (WebSocketSharp.WebSocket socket)
+ void WebSocketSharp.Server.IServiceHost.BindWebSocket (WebSocketSharp.Net.WebSockets.WebSocketContext context)

Parameters

-
+
- socket + context
- A WebSocketSharp.WebSocket to bind. + A WebSocketSharp.Net.WebSockets.WebSocketContext that contains the WebSocket connection request objects to bind.

Remarks

-
+
Documentation for this section has not yet been entered.

Requirements

-
+
Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/index.html b/websocket-sharp/doc/html/WebSocketSharp.Server/index.html index 0c860a27..41eaee95 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/index.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/index.html @@ -223,7 +223,7 @@ IServiceHost - Exposes the methods and property for the WebSocket service host. + Exposes the methods and property for the host that provides a WebSocketSharp.Server.WebSocketService. diff --git a/websocket-sharp/doc/html/WebSocketSharp/Ext.html b/websocket-sharp/doc/html/WebSocketSharp/Ext.html index c4a28db3..895fe25f 100644 --- a/websocket-sharp/doc/html/WebSocketSharp/Ext.html +++ b/websocket-sharp/doc/html/WebSocketSharp/Ext.html @@ -395,6 +395,17 @@ IsHostOrder (this ByteOrder) : bool
Determines whether the specified WebSocketSharp.ByteOrder is host (this computer architecture) byte order. +
+ + + +
static
+ + + + IsLocal + (this System.Net.IPAddress) : bool
+ Determines whether the specified System.Net.IPAddress represents a local IP address.
@@ -1333,6 +1344,54 @@ Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

+

IsLocal Method

+
+

+ Determines whether the specified System.Net.IPAddress represents a local IP address. +

+

Syntax

+
public static bool IsLocal (this System.Net.IPAddress address)
+

Parameters

+
+
+
+ address +
+
+ A System.Net.IPAddress to test. +
+
+
+

Returns

+
+ true if address represents a local IP address; otherwise, false. +
+

Exceptions

+
+ + + + + + + + + +
TypeReason
+ ArgumentNullException + + address is null. +
+
+

Remarks

+
+ Documentation for this section has not yet been entered. +
+

Requirements

+
+ Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
+
+

IsNull<T> Generic Method

diff --git a/websocket-sharp/doc/html/index.html b/websocket-sharp/doc/html/index.html index 4ae7515b..20fbfa3e 100644 --- a/websocket-sharp/doc/html/index.html +++ b/websocket-sharp/doc/html/index.html @@ -471,7 +471,7 @@ IServiceHost - Exposes the methods and property for the WebSocket service host. + Exposes the methods and property for the host that provides a WebSocketSharp.Server.WebSocketService. diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Net.WebSockets/HttpListenerWebSocketContext.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Net.WebSockets/HttpListenerWebSocketContext.xml index e1040d42..608c79eb 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Net.WebSockets/HttpListenerWebSocketContext.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Net.WebSockets/HttpListenerWebSocketContext.xml @@ -100,6 +100,23 @@ To be added. + + + + Property + + System.Boolean + + +

+ Gets a value indicating whether the WebSocket connection request is valid. + + + true if the WebSocket connection request is valid; otherwise, false. + + To be added. + + @@ -134,6 +151,23 @@ To be added. + + + + Property + + System.Collections.Specialized.NameValueCollection + + + + Gets the collection of query string variables used in the WebSocket opening handshake. + + + A that contains the collection of query string variables. + + To be added. + + diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Net.WebSockets/TcpListenerWebSocketContext.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Net.WebSockets/TcpListenerWebSocketContext.xml index 18aad13d..0e793af8 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Net.WebSockets/TcpListenerWebSocketContext.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Net.WebSockets/TcpListenerWebSocketContext.xml @@ -109,6 +109,23 @@ To be added. + + + + Property + + System.Boolean + + + + Gets a value indicating whether the WebSocket connection request is valid. + + + true if the WebSocket connection request is valid; otherwise, false. + + To be added. + + @@ -143,6 +160,23 @@ To be added. + + + + Property + + System.Collections.Specialized.NameValueCollection + + + + Gets the collection of query string variables used in the WebSocket opening handshake. + + + A that contains the collection of query string variables. + + To be added. + + diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Net.WebSockets/WebSocketContext.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Net.WebSockets/WebSocketContext.xml index 8a81e2f5..fd3a446b 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Net.WebSockets/WebSocketContext.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Net.WebSockets/WebSocketContext.xml @@ -114,6 +114,23 @@ To be added. + + + + Property + + System.Boolean + + + + Gets a value indicating whether the WebSocket connection request is valid. + + + true if the WebSocket connection request is valid; otherwise, false. + + To be added. + + @@ -131,6 +148,23 @@ To be added. + + + + Property + + System.Collections.Specialized.NameValueCollection + + + + Gets the collection of query string variables used in the WebSocket opening handshake. + + + A that contains the collection of query string variables. + + To be added. + + diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Net/HttpListenerRequest.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Net/HttpListenerRequest.xml index 402e1747..8da73cc7 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Net/HttpListenerRequest.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Net/HttpListenerRequest.xml @@ -214,8 +214,12 @@ System.Boolean - To be added. - To be added. + + Gets a value indicating whether the request is sent from the local computer. + + + true if the request is sent from the local computer; otherwise, false. + To be added. @@ -240,8 +244,12 @@ System.Boolean - To be added. - To be added. + + Gets a value indicating whether the request is a WebSocket connection request. + + + true if the request is a WebSocket connection request; otherwise, false. + To be added. diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/IServiceHost.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/IServiceHost.xml index 79c90f42..b2ccde9a 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/IServiceHost.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/IServiceHost.xml @@ -7,27 +7,27 @@ - Exposes the methods and property for the WebSocket service host. + Exposes the methods and property for the host that provides a . - - + + Method System.Void - + - - A to bind. + + A that contains the WebSocket connection request objects to bind. - Binds the specified to the WebSocket service instance. + Binds the specified to a instance. To be added. diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServer.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServer.xml index a9a2f431..57d63ae5 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServer.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServer.xml @@ -150,7 +150,7 @@ A that contains the WebSocket connection request objects. - Accepts a WebSocket connection. + Accepts a WebSocket connection request. To be added. diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServerBase.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServerBase.xml index a948dd35..2f93a71f 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServerBase.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServerBase.xml @@ -112,7 +112,7 @@ A that contains the WebSocket connection request objects. - Accepts a WebSocket connection. + Accepts a WebSocket connection request. To be added. diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketService.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketService.xml index d9ffbc72..f3daacdd 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketService.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketService.xml @@ -327,10 +327,10 @@ - Gets the HTTP query string variables used in the WebSocket opening handshake. + Gets the collection of query string variables used in the WebSocket opening handshake. - A that contains the query string variables. + A that contains the collection of query string variables. To be added. @@ -434,10 +434,10 @@ - Gets the sessions to the WebSocket service. + Gets the sessions to the . - A that contains the sessions to the WebSocket service. + A that contains the sessions to the the . To be added. diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServiceHost`1.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServiceHost`1.xml index 4ebdf676..0b704aec 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServiceHost`1.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServiceHost`1.xml @@ -209,7 +209,7 @@ A that contains the WebSocket connection request objects. - Accepts a WebSocket connection. + Accepts a WebSocket connection request. To be added. @@ -309,21 +309,21 @@ - - + + Method System.Void - + - - A to bind. + + A that contains the WebSocket connection request objects to bind. - Binds the specified to the WebSocket service instance. + Binds the specified to a instance. To be added. diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp/Ext.xml b/websocket-sharp/doc/mdoc/WebSocketSharp/Ext.xml index 0a698f1b..0d3e15d3 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp/Ext.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp/Ext.xml @@ -431,6 +431,32 @@ To be added. + + + + Method + + System.Boolean + + + + + + + A to test. + + + Determines whether the specified represents a local IP address. + + + true if represents a local IP address; otherwise, false. + + To be added. + + is . + + + diff --git a/websocket-sharp/doc/mdoc/index.xml b/websocket-sharp/doc/mdoc/index.xml index c64307ee..6d7061be 100644 --- a/websocket-sharp/doc/mdoc/index.xml +++ b/websocket-sharp/doc/mdoc/index.xml @@ -1,6 +1,6 @@ - + [00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 11 00 00 00 29 17 fb 89 fe c3 91 f7 2b cb 8b e2 61 d2 3f 05 93 6d 65 a8 9e 63 72 a6 f5 d5 2c f2 9d 20 fa 0b c0 70 6a f6 88 7e 8b 90 3f 39 f5 76 c8 48 e0 bb 7b b2 7b ed d3 10 a7 1a 0f 70 98 0f 7f f4 4b 53 09 d2 a5 ef 36 c3 56 b4 aa f0 91 72 63 25 07 89 e0 93 3e 3f 2e f2 b9 73 0e 12 15 5d 43 56 c3 f4 70 a5 89 fe f7 f6 ac 3e 77 c2 d8 d0 84 91 f4 0c d1 f3 8e dc c3 c3 b8 38 3d 0c bf 17 de 20 78 c1 ] @@ -525,6 +525,31 @@ + + + + + + + + ExtensionMethod + + System.Boolean + + + + + + + A to test. + + + Determines whether the specified represents a local IP address. + + + + + diff --git a/websocket-sharp/websocket-sharp.pidb b/websocket-sharp/websocket-sharp.pidb index 360ea1e7..1541ae36 100644 Binary files a/websocket-sharp/websocket-sharp.pidb and b/websocket-sharp/websocket-sharp.pidb differ