diff --git a/Example/Example.pidb b/Example/Example.pidb index 91b3ae1b..5ad31e7d 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 7b990bc6..d6540a1c 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 d1790e2d..cc8a5b45 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 18aa4731..2234c67b 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 e6ebba4f..5104efe3 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 2985dda5..db58ae88 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 6de87e18..f2f8ffd4 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 1479b294..263f150d 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 2573ad40..064f6637 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 6309273f..aebf0ae3 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 334ea401..9e8af838 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 9449435b..c1c22726 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 22462df0..bdcc677b 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 4176291b..17b81b6e 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 8ef32166..44b68338 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 18aa4731..2234c67b 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 e6ebba4f..5104efe3 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 2ab2bafa..ea743608 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 2b36da31..fdffbc97 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 1479b294..263f150d 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 2573ad40..064f6637 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 72091fdd..8b285932 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 334ea401..9e8af838 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 e5f9b390..8be6d9ba 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 22462df0..bdcc677b 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/Chat.cs b/Example2/Chat.cs index fb0c13ca..5fd3c229 100644 --- a/Example2/Chat.cs +++ b/Example2/Chat.cs @@ -23,22 +23,22 @@ namespace Example2 { return Interlocked.Increment(ref _num); } - protected override void OnOpen(object sender, EventArgs e) + protected override void OnOpen() { _name = getName(); } - protected override void OnMessage(object sender, MessageEventArgs e) + protected override void OnMessage(MessageEventArgs e) { var msg = String.Format("{0}: {1}", _name, e.Data); - Publish(msg); + Broadcast(msg); } - protected override void OnClose(object sender, CloseEventArgs e) + protected override void OnClose(CloseEventArgs e) { var msg = String.Format("{0} got logged off...", _name); - Publish(msg); + Broadcast(msg); } } } diff --git a/Example2/Echo.cs b/Example2/Echo.cs index 8d87c2d5..831e125b 100644 --- a/Example2/Echo.cs +++ b/Example2/Echo.cs @@ -6,7 +6,7 @@ namespace Example2 { public class Echo : WebSocketService { - protected override void OnMessage(object sender, MessageEventArgs e) + protected override void OnMessage(MessageEventArgs e) { var msg = QueryString.Exists("name") ? String.Format("'{0}' returns to {1}", e.Data, QueryString["name"]) diff --git a/Example2/Example2.pidb b/Example2/Example2.pidb index 79a5d499..b7225fcd 100644 Binary files a/Example2/Example2.pidb and b/Example2/Example2.pidb differ diff --git a/Example2/Program.cs b/Example2/Program.cs index a02f2012..8275fcd9 100644 --- a/Example2/Program.cs +++ b/Example2/Program.cs @@ -40,7 +40,7 @@ namespace Example2 wssv.Start(); Console.WriteLine( "WebSocket Server listening on port: {0} service path:", wssv.Port); - foreach (var path in wssv.ServicePath) + foreach (var path in wssv.ServicePaths) Console.WriteLine(" {0}", path); Console.WriteLine(); diff --git a/Example2/bin/Debug/example2.exe b/Example2/bin/Debug/example2.exe index 727b45f7..71f5f0e9 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 7f51dd0e..72ec4450 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 18aa4731..2234c67b 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 e6ebba4f..5104efe3 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 f89b4877..56109290 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 b02edbea..248d1f26 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 1479b294..263f150d 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 2573ad40..064f6637 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 ee01b0d7..e46fa894 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 334ea401..9e8af838 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 b820e640..26c56889 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 22462df0..bdcc677b 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/Chat.cs b/Example3/Chat.cs index 2e96c16e..85e920fe 100644 --- a/Example3/Chat.cs +++ b/Example3/Chat.cs @@ -23,22 +23,22 @@ namespace Example3 { return Interlocked.Increment(ref _num); } - protected override void OnOpen(object sender, EventArgs e) + protected override void OnOpen() { _name = getName(); } - protected override void OnMessage(object sender, MessageEventArgs e) + protected override void OnMessage(MessageEventArgs e) { var msg = String.Format("{0}: {1}", _name, e.Data); - Publish(msg); + Broadcast(msg); } - protected override void OnClose(object sender, CloseEventArgs e) + protected override void OnClose(CloseEventArgs e) { var msg = String.Format("{0} got logged off...", _name); - Publish(msg); + Broadcast(msg); } } } diff --git a/Example3/Echo.cs b/Example3/Echo.cs index 637a0e16..48c36d64 100644 --- a/Example3/Echo.cs +++ b/Example3/Echo.cs @@ -6,7 +6,7 @@ namespace Example3 { public class Echo : WebSocketService { - protected override void OnMessage(object sender, MessageEventArgs e) + protected override void OnMessage(MessageEventArgs e) { var msg = QueryString.Exists("name") ? String.Format("'{0}' returns to {1}", e.Data, QueryString["name"]) diff --git a/Example3/Example3.pidb b/Example3/Example3.pidb index 2c4bf55e..02340dae 100644 Binary files a/Example3/Example3.pidb and b/Example3/Example3.pidb differ diff --git a/Example3/bin/Debug/Example3.exe b/Example3/bin/Debug/Example3.exe index e0ecb48f..3df43495 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 d1af032f..ca2e3e84 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 18aa4731..2234c67b 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 e6ebba4f..5104efe3 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 2796c7f7..e3cc31b0 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 6e929246..dc2a375d 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 1479b294..263f150d 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 2573ad40..064f6637 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 f79eb1f4..3620a30e 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 334ea401..9e8af838 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 ec78f681..91e5f221 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 22462df0..bdcc677b 100755 Binary files a/Example3/bin/Release_Ubuntu/websocket-sharp.dll and b/Example3/bin/Release_Ubuntu/websocket-sharp.dll differ diff --git a/README.md b/README.md index cef4fd7f..4e1a3cbd 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ #### Step 1 #### -Required namespaces. +Required namespace. ```cs using WebSocketSharp; @@ -163,7 +163,7 @@ using WebSocketSharp.Server; public class Echo : WebSocketService { - protected override void OnMessage(object sender, MessageEventArgs e) + protected override void OnMessage(MessageEventArgs e) { Send(e.Data); } @@ -179,9 +179,9 @@ using WebSocketSharp.Server; public class Chat : WebSocketService { - protected override void OnMessage(object sender, MessageEventArgs e) + protected override void OnMessage(MessageEventArgs e) { - Publish(e.Data); + Broadcast(e.Data); } } ``` diff --git a/websocket-sharp/Ext.cs b/websocket-sharp/Ext.cs index 4dfe2873..6415453a 100644 --- a/websocket-sharp/Ext.cs +++ b/websocket-sharp/Ext.cs @@ -74,28 +74,59 @@ namespace WebSocketSharp { #region Public Methods /// - /// Accept a WebSocket connection by the . + /// Accepts a WebSocket connection by the . /// /// - /// A that contains a WebSocket connection. + /// A that contains a WebSocket connection. /// - /// - /// A that contains a TCP connection to accept a WebSocket connection from. + /// + /// A that provides a TCP connection to accept a WebSocket connection. /// /// /// A that indicates a secure connection or not. (true indicates a secure connection.) /// /// - /// Is thrown when the parameter passed to a method is invalid because it is . + /// is . /// - public static TcpListenerWebSocketContext AcceptWebSocket(this TcpClient client, bool secure) + public static TcpListenerWebSocketContext AcceptWebSocket(this TcpListener listener, bool secure) { - if (client.IsNull()) - throw new ArgumentNullException("client"); + if (listener.IsNull()) + throw new ArgumentNullException("listener"); + var client = listener.AcceptTcpClient(); return new TcpListenerWebSocketContext(client, secure); } + /// + /// Accepts a WebSocket connection asynchronously by the . + /// + /// + /// A that provides a TCP connection to accept a WebSocket connection. + /// + /// + /// A that indicates a secure connection or not. (true indicates a secure connection.) + /// + /// + /// An Action<TcpListenerWebSocketContext> delegate that contains the method(s) that is called when an asynchronous operation completes. + /// + /// + /// is . + /// + public static void AcceptWebSocketAsync(this TcpListener listener, bool secure, Action completed) + { + if (listener.IsNull()) + throw new ArgumentNullException("listener"); + + AsyncCallback callback = (ar) => + { + var client = listener.EndAcceptTcpClient(ar); + var context = new TcpListenerWebSocketContext(client, secure); + completed(context); + }; + + listener.BeginAcceptTcpClient(callback, null); + } + /// /// Emit the specified delegate if is not . /// diff --git a/websocket-sharp/Server/WebSocketServer.cs b/websocket-sharp/Server/WebSocketServer.cs index 4af51142..de8359f3 100644 --- a/websocket-sharp/Server/WebSocketServer.cs +++ b/websocket-sharp/Server/WebSocketServer.cs @@ -40,7 +40,7 @@ namespace WebSocketSharp.Server { /// Provides the functions of the server that receives the WebSocket connection requests. /// /// - /// The WebSocketServer class provides multi WebSocket service. + /// The WebSocketServer class provides the multi WebSocket service. /// public class WebSocketServer : WebSocketServerBase { @@ -53,7 +53,7 @@ namespace WebSocketSharp.Server { #region Public Constructors /// - /// Initializes a new instance of the WebSocketServer class. + /// Initializes a new instance of the class. /// public WebSocketServer() : this(80) @@ -61,7 +61,7 @@ namespace WebSocketSharp.Server { } /// - /// Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + /// Initializes a new instance of the class that listens for incoming connection attempts /// on the specified . /// /// @@ -73,7 +73,7 @@ namespace WebSocketSharp.Server { } /// - /// Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + /// Initializes a new instance of the class that listens for incoming connection attempts /// on the specified WebSocket URL. /// /// @@ -92,7 +92,7 @@ namespace WebSocketSharp.Server { } /// - /// Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + /// Initializes a new instance of the class that listens for incoming connection attempts /// on the specified and . /// /// @@ -107,11 +107,11 @@ namespace WebSocketSharp.Server { } /// - /// Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + /// Initializes a new instance of the class that listens for incoming connection attempts /// on the specified and . /// /// - /// An that contains an IP address. + /// A that contains an IP address. /// /// /// An that contains a port number. @@ -122,11 +122,11 @@ namespace WebSocketSharp.Server { } /// - /// Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + /// Initializes a new instance of the class that listens for incoming connection attempts /// on the specified , and . /// /// - /// An that contains an IP address. + /// A that contains an IP address. /// /// /// An that contains a port number. @@ -145,12 +145,12 @@ namespace WebSocketSharp.Server { #region Properties /// - /// Gets the service paths. + /// Gets the paths associated with the each WebSocket services. /// /// - /// An IEnumerable<string> that contains the service paths. + /// An IEnumerable<string> that contains the paths. /// - public IEnumerable ServicePath { + public IEnumerable ServicePaths { get { var url = BaseUri.IsAbsoluteUri ? BaseUri.ToString().TrimEnd('/') @@ -190,16 +190,15 @@ namespace WebSocketSharp.Server { #region Protected Method /// - /// Accepts the WebSocket connection. + /// Accepts a WebSocket connection. /// - /// - /// A that contains the TCP connection. + /// + /// A that contains a WebSocket connection. /// - protected override void AcceptWebSocket(TcpClient client) + protected override void AcceptWebSocket(TcpListenerWebSocketContext context) { - var context = client.AcceptWebSocket(IsSecure); - var socket = context.WebSocket; - var path = context.Path.UrlDecode(); + var socket = context.WebSocket; + var path = context.Path.UrlDecode(); IServiceHost svcHost; if (!_services.TryGetServiceHost(path, out svcHost)) @@ -219,13 +218,13 @@ namespace WebSocketSharp.Server { #region Public Methods /// - /// Adds the WebSocket service. + /// Adds a WebSocket service. /// /// - /// A that contains an absolute path associated with the WebSocket service. + /// A that contains an absolute path associated with a WebSocket service. /// /// - /// The type of the WebSocket service. The T must inherit the class. + /// The type of a WebSocket service. The T must inherit the class. /// public void AddService(string absPath) where T : WebSocketService, new() @@ -248,7 +247,7 @@ namespace WebSocketSharp.Server { } /// - /// Broadcasts the specified . + /// Broadcasts the specified to all clients. /// /// /// A to broadcast. diff --git a/websocket-sharp/Server/WebSocketServerBase.cs b/websocket-sharp/Server/WebSocketServerBase.cs index 940f78c7..1cd0c3c7 100644 --- a/websocket-sharp/Server/WebSocketServerBase.cs +++ b/websocket-sharp/Server/WebSocketServerBase.cs @@ -31,6 +31,7 @@ using System.Diagnostics; using System.Net; using System.Net.Sockets; using System.Threading; +using WebSocketSharp.Net.WebSockets; namespace WebSocketSharp.Server { @@ -44,7 +45,7 @@ namespace WebSocketSharp.Server { #region Fields - private Thread _acceptClientThread; + private Thread _receiveRequestThread; private IPAddress _address; private bool _isSecure; private bool _isSelfHost; @@ -57,7 +58,7 @@ namespace WebSocketSharp.Server { #region Constructors /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// protected WebSocketServerBase() { @@ -65,7 +66,7 @@ namespace WebSocketSharp.Server { } /// - /// Initializes a new instance of the class that listens for incoming connection attempts + /// Initializes a new instance of the class that listens for incoming connection attempts /// on the specified WebSocket URL. /// /// @@ -91,17 +92,17 @@ namespace WebSocketSharp.Server { } /// - /// Initializes a new instance of the class that listens for incoming connection attempts + /// Initializes a new instance of the class that listens for incoming connection attempts /// on the specified , , and . /// /// - /// An that contains a local IP address. + /// A that contains an IP address. /// /// /// An that contains a port number. /// /// - /// A that contains a absolute path. + /// A that contains an absolute path. /// /// /// A that indicates providing a secure connection or not. (true indicates providing a secure connection.) @@ -176,10 +177,10 @@ namespace WebSocketSharp.Server { #region Public Properties /// - /// Gets the local IP address on which to listen for incoming connection attempts. + /// Gets the IP address on which to listen for incoming connection attempts. /// /// - /// A that contains a local IP address. + /// A that contains an IP address. /// public IPAddress Address { get { @@ -188,10 +189,10 @@ namespace WebSocketSharp.Server { } /// - /// Gets a value indicating whether this server is secure. + /// Gets a value indicating whether this server provides secure connection. /// /// - /// true if this server is secure; otherwise, false. + /// true if this server provides secure connection; otherwise, false. /// public bool IsSecure { get { @@ -236,35 +237,13 @@ namespace WebSocketSharp.Server { #region Private Methods - private void acceptClient() + private void acceptWebSocketAsync(TcpListenerWebSocketContext context) { - while (true) - { - try - { - var client = _tcpListener.AcceptTcpClient(); - acceptSocketAsync(client); - } - catch (SocketException) - { - // TcpListener has been stopped. - break; - } - catch (Exception ex) - { - onError(ex.Message); - break; - } - } - } - - private void acceptSocketAsync(TcpClient client) - { - WaitCallback acceptSocketCb = (state) => + WaitCallback callback = (state) => { try { - AcceptWebSocket(client); + AcceptWebSocket(context); } catch (Exception ex) { @@ -272,7 +251,7 @@ namespace WebSocketSharp.Server { } }; - ThreadPool.QueueUserWorkItem(acceptSocketCb); + ThreadPool.QueueUserWorkItem(callback); } private void init() @@ -308,11 +287,33 @@ namespace WebSocketSharp.Server { OnError.Emit(this, new ErrorEventArgs(message)); } - private void startAcceptClientThread() + private void receiveRequest() + { + while (true) + { + try + { + var context = _tcpListener.AcceptWebSocket(_isSecure); + acceptWebSocketAsync(context); + } + catch (SocketException) + { + // TcpListener has been stopped. + break; + } + catch (Exception ex) + { + onError(ex.Message); + break; + } + } + } + + private void startReceiveRequestThread() { - _acceptClientThread = new Thread(new ThreadStart(acceptClient)); - _acceptClientThread.IsBackground = true; - _acceptClientThread.Start(); + _receiveRequestThread = new Thread(new ThreadStart(receiveRequest)); + _receiveRequestThread.IsBackground = true; + _receiveRequestThread.Start(); } private bool tryCreateUri(string uriString, out Uri result, out string message) @@ -335,15 +336,15 @@ namespace WebSocketSharp.Server { #region Protected Methods /// - /// Accepts the WebSocket connection. + /// Accepts a WebSocket connection. /// - /// - /// A that contains the WebSocket connection. + /// + /// A that contains a WebSocket connection. /// - protected abstract void AcceptWebSocket(TcpClient client); + protected abstract void AcceptWebSocket(TcpListenerWebSocketContext context); /// - /// Occurs the event with the specified . + /// Occurs the event with the specified . /// /// /// A that contains an error message. @@ -366,7 +367,7 @@ namespace WebSocketSharp.Server { return; _tcpListener.Start(); - startAcceptClientThread(); + startReceiveRequestThread(); } /// @@ -378,7 +379,7 @@ namespace WebSocketSharp.Server { return; _tcpListener.Stop(); - _acceptClientThread.Join(5 * 1000); + _receiveRequestThread.Join(5 * 1000); } #endregion diff --git a/websocket-sharp/Server/WebSocketService.cs b/websocket-sharp/Server/WebSocketService.cs index cbe0fa32..dead0831 100644 --- a/websocket-sharp/Server/WebSocketService.cs +++ b/websocket-sharp/Server/WebSocketService.cs @@ -33,6 +33,12 @@ using System.Threading; namespace WebSocketSharp.Server { + /// + /// Provides the basic functions of the WebSocket service. + /// + /// + /// The WebSocketService class is an abstract class. + /// public abstract class WebSocketService { #region Private Fields @@ -44,6 +50,9 @@ namespace WebSocketSharp.Server { #region Public Constructor + /// + /// Initializes a new instance of the class. + /// public WebSocketService() { ID = String.Empty; @@ -54,12 +63,24 @@ namespace WebSocketSharp.Server { #region Protected Properties + /// + /// Gets the HTTP query string variables used in the WebSocket opening handshake. + /// + /// + /// A that contains the query string variables. + /// protected NameValueCollection QueryString { get { return IsBound ? _socket.QueryString : null; } } + /// + /// Gets the sessions to the WebSocket service. + /// + /// + /// A that contains the sessions to the WebSocket service. + /// protected SessionManager Sessions { get { return IsBound ? _sessions : null; @@ -70,44 +91,46 @@ namespace WebSocketSharp.Server { #region Public Properties - public string ID { get; private set; } - public bool IsBound { get; private set; } + /// + /// Gets the ID of a instance. + /// + /// + /// A that contains a ID. + /// + public string ID { get; private set; } + + /// + /// Gets a value indicating whether a instance is bound to a . + /// + /// + /// true if the WebSocketService is bound to a WebSocket; otherwise, false. + /// + public bool IsBound { get; private set; } #endregion - #region Private Method + #region Private Methods - private void defaultBind() + private void onClose(object sender, CloseEventArgs e) { - _socket.OnOpen += (sender, e) => - { - ID = _sessions.Add(this); - }; - - _socket.OnClose += (sender, e) => - { - _sessions.Remove(ID); - }; + _sessions.Remove(ID); + OnClose(e); } - #endregion - - #region Protected Methods - - protected virtual void OnClose(object sender, CloseEventArgs e) + private void onError(object sender, ErrorEventArgs e) { + OnError(e); } - protected virtual void OnError(object sender, ErrorEventArgs e) + private void onMessage(object sender, MessageEventArgs e) { + OnMessage(e); } - protected virtual void OnMessage(object sender, MessageEventArgs e) - { - } - - protected virtual void OnOpen(object sender, EventArgs e) + private void onOpen(object sender, EventArgs e) { + ID = _sessions.Add(this); + OnOpen(); } #endregion @@ -126,51 +149,182 @@ namespace WebSocketSharp.Server { #endregion + #region Protected Methods + + /// + /// Occurs when a inner receives a Close frame or the Stop method is called. + /// + /// + /// A that contains the event data associated with a event. + /// + protected virtual void OnClose(CloseEventArgs e) + { + } + + /// + /// Occurs when a inner gets an error. + /// + /// + /// An that contains the event data associated with a event. + /// + protected virtual void OnError(ErrorEventArgs e) + { + } + + /// + /// Occurs when a inner receives a data frame. + /// + /// + /// A that contains the event data associated with a event. + /// + protected virtual void OnMessage(MessageEventArgs e) + { + } + + /// + /// Occurs when the WebSocket connection has been established. + /// + protected virtual void OnOpen() + { + } + + #endregion + #region Public Methods + /// + /// Binds the specified and + /// to a instance. + /// + /// + /// A to bind to the WebSocketService. + /// + /// + /// A to bind to the WebSocketService. + /// public void Bind(WebSocket socket, SessionManager sessions) { + if (IsBound) + return; + _socket = socket; _sessions = sessions; - defaultBind(); - _socket.OnOpen += OnOpen; - _socket.OnMessage += OnMessage; - _socket.OnError += OnError; - _socket.OnClose += OnClose; + _socket.OnOpen += onOpen; + _socket.OnMessage += onMessage; + _socket.OnError += onError; + _socket.OnClose += onClose; IsBound = true; } - public bool Ping() + /// + /// Broadcasts the specified array of to all clients of the WebSocket service. + /// + /// + /// An array of to broadcast. + /// + public void Broadcast(byte[] data) { - return Ping(String.Empty); + if (IsBound) + _sessions.Broadcast(data); } - public bool Ping(string message) + /// + /// Broadcasts the specified to all clients of the WebSocket service. + /// + /// + /// A to broadcast. + /// + public void Broadcast(string data) { - return IsBound - ? _socket.Ping(message) - : false; + if (IsBound) + _sessions.Broadcast(data); } - public Dictionary PingAround() + /// + /// Pings to all clients of the WebSocket service. + /// + /// + /// A Dictionary<string, bool> that contains the collection of the ID and value + /// indicating whether the WebSocket service received a Pong in a time. + /// + public Dictionary Broadping() { - return PingAround(String.Empty); + return Broadping(String.Empty); } - public Dictionary PingAround(string message) + /// + /// Pings with the specified to all clients of the WebSocket service. + /// + /// + /// A Dictionary<string, bool> that contains the collection of the ID and value + /// indicating whether the WebSocket service received a Pong in a time. + /// + /// + /// A that contains a message. + /// + public Dictionary Broadping(string message) { return IsBound ? _sessions.Broadping(message) : null; } + /// + /// Pings to the client of a instance. + /// + /// + /// true if the WebSocketService receives a Pong in a time; otherwise, false. + /// + public bool Ping() + { + return Ping(String.Empty); + } + + /// + /// Pings with the specified to the client of a instance. + /// + /// + /// true if the WebSocketService receives a Pong in a time; otherwise, false. + /// + /// + /// A that contains a message. + /// + public bool Ping(string message) + { + return IsBound + ? _socket.Ping(message) + : false; + } + + /// + /// Pings to the client of a instance associated with the specified ID. + /// + /// + /// true if the WebSocket service receives a Pong in a time; otherwise, false. + /// + /// + /// A that contains a ID that represents the destination for the Ping. + /// public bool PingTo(string id) { return PingTo(id, String.Empty); } + /// + /// Pings with the specified to the client of a instance + /// associated with the specified ID. + /// + /// + /// true if the WebSocketService receives a Pong in a time; otherwise, false. + /// + /// + /// A that contains a ID that represents the destination for the Ping. + /// + /// + /// A that contains a message. + /// public bool PingTo(string id, string message) { if (!IsBound) @@ -182,30 +336,39 @@ namespace WebSocketSharp.Server { : false; } - public void Publish(byte[] data) - { - if (IsBound) - _sessions.Broadcast(data); - } - - public void Publish(string data) - { - if (IsBound) - _sessions.Broadcast(data); - } - + /// + /// Sends a binary data to the client of a instance. + /// + /// + /// An array of that contains a binary data to send. + /// public void Send(byte[] data) { if (IsBound) _socket.Send(data); } + /// + /// Sends a text data to the client of a instance. + /// + /// + /// A that contains a text data to send. + /// public void Send(string data) { if (IsBound) _socket.Send(data); } + /// + /// Sends a binary data to the client of a instance associated with the specified ID. + /// + /// + /// A that contains a ID that represents the destination for the data. + /// + /// + /// An array of that contains a binary data to send. + /// public void SendTo(string id, byte[] data) { if (!IsBound) @@ -216,6 +379,15 @@ namespace WebSocketSharp.Server { service.Send(data); } + /// + /// Sends a text data to the client of a instance associated with the specified ID. + /// + /// + /// A that contains a ID that represents the destination for the data. + /// + /// + /// A that contains a text data to send. + /// public void SendTo(string id, string data) { if (!IsBound) @@ -226,12 +398,18 @@ namespace WebSocketSharp.Server { service.Send(data); } + /// + /// Starts a instance. + /// public void Start() { if (IsBound) _socket.Connect(); } + /// + /// Stops a instance. + /// public void Stop() { if (!IsBound) @@ -240,11 +418,29 @@ namespace WebSocketSharp.Server { _socket.Close(); } + /// + /// Stops a instance with the specified and . + /// + /// + /// One of the values that contains a status code indicating the reason for stop. + /// + /// + /// A that contains a reason for stop. + /// public void Stop(CloseStatusCode code, string reason) { Stop((ushort)code, reason); } + /// + /// Stops a instance with the specified and . + /// + /// + /// A that contains a status code indicating the reason for stop. + /// + /// + /// A that contains a reason for stop. + /// public void Stop(ushort code, string reason) { if (!IsBound) diff --git a/websocket-sharp/Server/WebSocketServiceHost.cs b/websocket-sharp/Server/WebSocketServiceHost.cs index ab7e0eaf..d2278a1f 100644 --- a/websocket-sharp/Server/WebSocketServiceHost.cs +++ b/websocket-sharp/Server/WebSocketServiceHost.cs @@ -32,6 +32,7 @@ using System; using System.Collections.Generic; using System.Net.Sockets; using WebSocketSharp.Net; +using WebSocketSharp.Net.WebSockets; namespace WebSocketSharp.Server { @@ -39,7 +40,7 @@ namespace WebSocketSharp.Server { /// Provides the functions of the server that receives the WebSocket connection requests. /// /// - /// The WebSocketServiceHost<T> class provides single WebSocket service. + /// The WebSocketServiceHost<T> class provides the single WebSocket service. /// /// /// The type of the WebSocket service that the server provides. The T must inherit the class. @@ -142,7 +143,7 @@ namespace WebSocketSharp.Server { /// on the specified , and . /// /// - /// An that contains an IP address. + /// A that contains an IP address. /// /// /// An that contains a port number. @@ -160,7 +161,7 @@ namespace WebSocketSharp.Server { /// on the specified , , and . /// /// - /// An that contains an IP address. + /// A that contains an IP address. /// /// /// An that contains a port number. @@ -244,16 +245,15 @@ namespace WebSocketSharp.Server { #region Protected Method /// - /// Accepts the WebSocket connection. + /// Accepts a WebSocket connection. /// - /// - /// A that contains the TCP connection. + /// + /// A that contains a WebSocket connection. /// - protected override void AcceptWebSocket(TcpClient client) + protected override void AcceptWebSocket(TcpListenerWebSocketContext context) { - var context = client.AcceptWebSocket(IsSecure); - var socket = context.WebSocket; - var path = context.Path.UrlDecode(); + var socket = context.WebSocket; + var path = context.Path.UrlDecode(); if (path != Uri.GetAbsolutePath().UrlDecode()) { socket.Close(HttpStatusCode.NotImplemented); @@ -271,7 +271,7 @@ namespace WebSocketSharp.Server { #region Public Methods /// - /// Broadcasts the specified . + /// Broadcasts the specified to all clients. /// /// /// A to broadcast. @@ -284,6 +284,10 @@ namespace WebSocketSharp.Server { /// /// Pings with the specified to all clients. /// + /// + /// A Dictionary<string, bool> that contains the collection of the session ID and value + /// indicating whether the server received a Pong in a time. + /// /// /// A that contains a message. /// diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index 67341cfb..ea077cca 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -303,24 +303,24 @@ namespace WebSocketSharp { #region Events /// - /// Occurs when the WebSocket connection has been established. + /// Occurs when the WebSocket receives a Close frame or the Close method is called. /// - public event EventHandler OnOpen; + public event EventHandler OnClose; /// - /// Occurs when the WebSocket receives a data frame. + /// Occurs when the WebSocket gets an error. /// - public event EventHandler OnMessage; + public event EventHandler OnError; /// - /// Occurs when the WebSocket gets an error. + /// Occurs when the WebSocket receives a data frame. /// - public event EventHandler OnError; + public event EventHandler OnMessage; /// - /// Occurs when the WebSocket receives a Close frame or the Close method is called. + /// Occurs when the WebSocket connection has been established. /// - public event EventHandler OnClose; + public event EventHandler OnOpen; #endregion @@ -1140,7 +1140,7 @@ namespace WebSocketSharp { /// Closes the connection and releases all associated resources after sends a Close control frame. /// /// - /// A that contains a status code indicating a reason for closure. + /// A that contains a status code indicating a reason for closure. /// public void Close(CloseStatusCode code) { @@ -1162,7 +1162,7 @@ namespace WebSocketSharp { /// Closes the connection and releases all associated resources after sends a Close control frame. /// /// - /// A that contains a status code indicating a reason for closure. + /// A that contains a status code indicating a reason for closure. /// /// /// A that contains a reason for closure. @@ -1269,12 +1269,12 @@ namespace WebSocketSharp { } /// - /// Sends a text data using the connection. + /// Sends a binary data using the connection. /// /// - /// A that contains the text data to be sent. + /// An array of that contains a binary data to send. /// - public void Send(string data) + public void Send(byte[] data) { if (data.IsNull()) { @@ -1282,17 +1282,16 @@ namespace WebSocketSharp { return; } - var buffer = Encoding.UTF8.GetBytes(data); - send(Opcode.TEXT, buffer); + send(Opcode.BINARY, data); } /// - /// Sends a binary data using the connection. + /// Sends a text data using the connection. /// /// - /// An array of that contains the binary data to be sent. + /// A that contains a text data to send. /// - public void Send(byte[] data) + public void Send(string data) { if (data.IsNull()) { @@ -1300,14 +1299,15 @@ namespace WebSocketSharp { return; } - send(Opcode.BINARY, data); + var buffer = Encoding.UTF8.GetBytes(data); + send(Opcode.TEXT, buffer); } /// /// Sends a binary data using the connection. /// /// - /// A that contains the binary data to be sent. + /// A that contains a binary data to send. /// public void Send(FileInfo file) { @@ -1324,15 +1324,15 @@ namespace WebSocketSharp { } /// - /// Sends a text data asynchronously using the connection. + /// Sends a binary data asynchronously using the connection. /// /// - /// A that contains the text data to be sent. + /// An array of that contains a binary data to send. /// /// /// An delegate that contains the method(s) that is called when an asynchronous operation completes. /// - public void SendAsync(string data, Action completed) + public void SendAsync(byte[] data, Action completed) { if (data.IsNull()) { @@ -1340,20 +1340,19 @@ namespace WebSocketSharp { return; } - var buffer = Encoding.UTF8.GetBytes(data); - sendAsync(Opcode.TEXT, buffer, completed); + sendAsync(Opcode.BINARY, data, completed); } /// - /// Sends a binary data asynchronously using the connection. + /// Sends a text data asynchronously using the connection. /// /// - /// An array of that contains the binary data to be sent. + /// A that contains a text data to send. /// /// /// An delegate that contains the method(s) that is called when an asynchronous operation completes. /// - public void SendAsync(byte[] data, Action completed) + public void SendAsync(string data, Action completed) { if (data.IsNull()) { @@ -1361,14 +1360,15 @@ namespace WebSocketSharp { return; } - sendAsync(Opcode.BINARY, data, completed); + var buffer = Encoding.UTF8.GetBytes(data); + sendAsync(Opcode.TEXT, buffer, completed); } /// /// Sends a binary data asynchronously using the connection. /// /// - /// A that contains the binary data to be sent. + /// A that contains a binary data to send. /// /// /// An delegate that contains the method(s) that is called when an asynchronous operation completes. diff --git a/websocket-sharp/bin/Debug/websocket-sharp.dll b/websocket-sharp/bin/Debug/websocket-sharp.dll index 18aa4731..2234c67b 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 e6ebba4f..5104efe3 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 1479b294..263f150d 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 2573ad40..064f6637 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 334ea401..9e8af838 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 22462df0..bdcc677b 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 2c607ed9..0ca5374a 100644 --- a/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.xml +++ b/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.xml @@ -9,21 +9,38 @@ Provides a set of static methods for the websocket-sharp. - + - Accept a WebSocket connection by the . + Accepts a WebSocket connection by the . A that contains a WebSocket connection. - - A that contains a TCP connection to accept a WebSocket connection from. + + A that provides a TCP connection to accept a WebSocket connection. A that indicates a secure connection or not. (true indicates a secure connection.) - Is thrown when the parameter passed to a method is invalid because it is . + is . + + + + + Accepts a WebSocket connection asynchronously by the . + + + A that provides a TCP connection to accept a WebSocket connection. + + + A that indicates a secure connection or not. (true indicates a secure connection.) + + + An Action<TcpListenerWebSocketContext> delegate that contains the method(s) that is called when an asynchronous operation completes. + + + is . @@ -792,24 +809,24 @@ is not valid WebSocket URL. - + - Occurs when the WebSocket connection has been established. + Occurs when the WebSocket receives a Close frame or the Close method is called. - + - Occurs when the WebSocket receives a data frame. + Occurs when the WebSocket gets an error. - + - Occurs when the WebSocket gets an error. + Occurs when the WebSocket receives a data frame. - + - Occurs when the WebSocket receives a Close frame or the Close method is called. + Occurs when the WebSocket connection has been established. @@ -870,7 +887,7 @@ Closes the connection and releases all associated resources after sends a Close control frame. - A that contains a status code indicating a reason for closure. + A that contains a status code indicating a reason for closure. @@ -886,7 +903,7 @@ Closes the connection and releases all associated resources after sends a Close control frame. - A that contains a status code indicating a reason for closure. + A that contains a status code indicating a reason for closure. A that contains a reason for closure. @@ -938,20 +955,20 @@ true if the WebSocket receives a Pong frame in a time; otherwise, false. - + - Sends a text data using the connection. + Sends a binary data using the connection. - A that contains the text data to be sent. + An array of that contains a binary data to send. - + - Sends a binary data using the connection. + Sends a text data using the connection. - An array of that contains the binary data to be sent. + A that contains a text data to send. @@ -959,26 +976,26 @@ Sends a binary data using the connection. - A that contains the binary data to be sent. + A that contains a binary data to send. - + - Sends a text data asynchronously using the connection. + Sends a binary data asynchronously using the connection. - A that contains the text data to be sent. + An array of that contains a binary data to send. An delegate that contains the method(s) that is called when an asynchronous operation completes. - + - Sends a binary data asynchronously using the connection. + Sends a text data asynchronously using the connection. - An array of that contains the binary data to be sent. + A that contains a text data to send. An delegate that contains the method(s) that is called when an asynchronous operation completes. @@ -989,7 +1006,7 @@ Sends a binary data asynchronously using the connection. - A that contains the binary data to be sent. + A that contains a binary data to send. An delegate that contains the method(s) that is called when an asynchronous operation completes. @@ -1000,17 +1017,17 @@ Provides the functions of the server that receives the WebSocket connection requests. - The WebSocketServer class provides multi WebSocket service. + The WebSocketServer class provides the multi WebSocket service. - Initializes a new instance of the WebSocketServer class. + Initializes a new instance of the class. - Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the class that listens for incoming connection attempts on the specified . @@ -1019,7 +1036,7 @@ - Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the class that listens for incoming connection attempts on the specified WebSocket URL. @@ -1028,7 +1045,7 @@ - Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the class that listens for incoming connection attempts on the specified and . @@ -1040,11 +1057,11 @@ - Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the class that listens for incoming connection attempts on the specified and . - An that contains an IP address. + A that contains an IP address. An that contains a port number. @@ -1052,11 +1069,11 @@ - Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the class that listens for incoming connection attempts on the specified , and . - An that contains an IP address. + A that contains an IP address. An that contains a port number. @@ -1065,12 +1082,12 @@ A that indicates providing a secure connection or not. (true indicates providing a secure connection.) - + - Gets the service paths. + Gets the paths associated with the each WebSocket services. - An IEnumerable<string> that contains the service paths. + An IEnumerable<string> that contains the paths. @@ -1081,28 +1098,28 @@ true if the server cleans up the inactive client; otherwise, false. - + - Accepts the WebSocket connection. + Accepts a WebSocket connection. - - A that contains the TCP connection. + + A that contains a WebSocket connection. - Adds the WebSocket service. + Adds a WebSocket service. - A that contains an absolute path associated with the WebSocket service. + A that contains an absolute path associated with a WebSocket service. - The type of the WebSocket service. The T must inherit the class. + The type of a WebSocket service. The T must inherit the class. - Broadcasts the specified . + Broadcasts the specified to all clients. A to broadcast. @@ -1113,6 +1130,244 @@ Stops receiving the WebSocket connection requests. + + + Provides the basic functions of the WebSocket service. + + + The WebSocketService class is an abstract class. + + + + + Initializes a new instance of the class. + + + + + Gets the HTTP query string variables used in the WebSocket opening handshake. + + + A that contains the query string variables. + + + + + Gets the sessions to the WebSocket service. + + + A that contains the sessions to the WebSocket service. + + + + + Gets the ID of a instance. + + + A that contains a ID. + + + + + Gets a value indicating whether a instance is bound to a . + + + true if the WebSocketService is bound to a WebSocket; otherwise, false. + + + + + Occurs when a inner receives a Close frame or the Stop method is called. + + + A that contains the event data associated with a event. + + + + + Occurs when a inner gets an error. + + + An that contains the event data associated with a event. + + + + + Occurs when a inner receives a data frame. + + + A that contains the event data associated with a event. + + + + + Occurs when the WebSocket connection has been established. + + + + + Binds the specified and + to a instance. + + + A to bind to the WebSocketService. + + + A to bind to the WebSocketService. + + + + + Broadcasts the specified array of to all clients of the WebSocket service. + + + An array of to broadcast. + + + + + Broadcasts the specified to all clients of the WebSocket service. + + + A to broadcast. + + + + + Pings to all clients of the WebSocket service. + + + A Dictionary<string, bool> that contains the collection of the ID and value + indicating whether the WebSocket service received a Pong in a time. + + + + + Pings with the specified to all clients of the WebSocket service. + + + A Dictionary<string, bool> that contains the collection of the ID and value + indicating whether the WebSocket service received a Pong in a time. + + + A that contains a message. + + + + + Pings to the client of a instance. + + + true if the WebSocketService receives a Pong in a time; otherwise, false. + + + + + Pings with the specified to the client of a instance. + + + true if the WebSocketService receives a Pong in a time; otherwise, false. + + + A that contains a message. + + + + + Pings to the client of a instance associated with the specified ID. + + + true if the WebSocket service receives a Pong in a time; otherwise, false. + + + A that contains a ID that represents the destination for the Ping. + + + + + Pings with the specified to the client of a instance + associated with the specified ID. + + + true if the WebSocketService receives a Pong in a time; otherwise, false. + + + A that contains a ID that represents the destination for the Ping. + + + A that contains a message. + + + + + Sends a binary data to the client of a instance. + + + An array of that contains a binary data to send. + + + + + Sends a text data to the client of a instance. + + + A that contains a text data to send. + + + + + Sends a binary data to the client of a instance associated with the specified ID. + + + A that contains a ID that represents the destination for the data. + + + An array of that contains a binary data to send. + + + + + Sends a text data to the client of a instance associated with the specified ID. + + + A that contains a ID that represents the destination for the data. + + + A that contains a text data to send. + + + + + Starts a instance. + + + + + Stops a instance. + + + + + Stops a instance with the specified and . + + + One of the values that contains a status code indicating the reason for stop. + + + A that contains a reason for stop. + + + + + Stops a instance with the specified and . + + + A that contains a status code indicating the reason for stop. + + + A that contains a reason for stop. + + Decodes an HTML-encoded string and returns the decoded string. @@ -1175,13 +1430,13 @@ on the specified , , and . - An that contains a local IP address. + A that contains an IP address. An that contains a port number. - A that contains a absolute path. + A that contains an absolute path. A that indicates providing a secure connection or not. (true indicates providing a secure connection.) @@ -1216,18 +1471,18 @@ - Gets the local IP address on which to listen for incoming connection attempts. + Gets the IP address on which to listen for incoming connection attempts. - A that contains a local IP address. + A that contains an IP address. - Gets a value indicating whether this server is secure. + Gets a value indicating whether this server provides secure connection. - true if this server is secure; otherwise, false. + true if this server provides secure connection; otherwise, false. @@ -1246,17 +1501,17 @@ An that contains a port number. - + - Accepts the WebSocket connection. + Accepts a WebSocket connection. - - A that contains the WebSocket connection. + + A that contains a WebSocket connection. - Occurs the event with the specified . + Occurs the event with the specified . A that contains an error message. @@ -1318,7 +1573,7 @@ Provides the functions of the server that receives the WebSocket connection requests. - The WebSocketServiceHost<T> class provides single WebSocket service. + The WebSocketServiceHost<T> class provides the single WebSocket service. The type of the WebSocket service that the server provides. The T must inherit the class. @@ -1387,7 +1642,7 @@ on the specified , and . - An that contains an IP address. + A that contains an IP address. An that contains a port number. @@ -1402,7 +1657,7 @@ on the specified , , and . - An that contains an IP address. + A that contains an IP address. An that contains a port number. @@ -1438,17 +1693,17 @@ A to bind. - + - Accepts the WebSocket connection. + Accepts a WebSocket connection. - - A that contains the TCP connection. + + A that contains a WebSocket connection. - Broadcasts the specified . + Broadcasts the specified to all clients. A to broadcast. @@ -1458,6 +1713,10 @@ Pings with the specified to all clients. + + A Dictionary<string, bool> that contains the collection of the session ID and value + indicating whether the server received a Pong in a time. + A that contains a message. diff --git a/websocket-sharp/doc/doc.sh b/websocket-sharp/doc/doc.sh index 1730100a..e4f3fa6b 100755 --- a/websocket-sharp/doc/doc.sh +++ b/websocket-sharp/doc/doc.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# @(#) doc.sh ver.0.0.1 2013.01.11 +# @(#) doc.sh ver.0.0.2 2013.01.24 # # Usage: # doc.sh @@ -27,5 +27,5 @@ createDir() { set -e createDir ${MDOC_DIR} createDir ${HTML_DIR} -mdoc update -fno-assembly-versions -i ${XML} -o ${MDOC_DIR}/ ${DLL} +mdoc update --delete -fno-assembly-versions -i ${XML} -o ${MDOC_DIR}/ ${DLL} mdoc export-html -o ${HTML_DIR}/ ${MDOC_DIR}/ diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServer.html b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServer.html index 54dd0397..1db08742 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServer.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServer.html @@ -216,7 +216,7 @@

Remarks

- The WebSocketServer class provides multi WebSocket service. + The WebSocketServer class provides the multi WebSocket service.

Requirements

@@ -243,7 +243,7 @@ ()
- Initializes a new instance of the WebSocketServer class. + Initializes a new instance of the WebSocketSharp.Server.WebSocketServer class. @@ -258,7 +258,7 @@ (int)
- Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the WebSocketSharp.Server.WebSocketServer class that listens for incoming connection attempts on the specified port. @@ -274,7 +274,7 @@ (string) - Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the WebSocketSharp.Server.WebSocketServer class that listens for incoming connection attempts on the specified WebSocket URL. @@ -290,7 +290,7 @@ (int, bool) - Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the WebSocketSharp.Server.WebSocketServer class that listens for incoming connection attempts on the specified port and secure. @@ -306,7 +306,7 @@ (System.Net.IPAddress, int) - Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the WebSocketSharp.Server.WebSocketServer class that listens for incoming connection attempts on the specified address and port. @@ -322,7 +322,7 @@ (System.Net.IPAddress, int, bool) - Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the WebSocketSharp.Server.WebSocketServer class that listens for incoming connection attempts on the specified address, port and secure. @@ -344,7 +344,7 @@ System.Net.IPAddress . - Gets the local IP address on which to listen for incoming connection attempts. + Gets the IP address on which to listen for incoming connection attempts. (Inherited from WebSocketServerBase.) @@ -358,7 +358,7 @@ bool . - Gets a value indicating whether this server is secure. + Gets a value indicating whether this server provides secure connection. (Inherited from WebSocketServerBase.) @@ -393,14 +393,14 @@ [read-only]
- ServicePath + ServicePaths IEnumerable<string> . - Gets the service paths. + Gets the paths associated with the each WebSocket services. @@ -460,7 +460,7 @@ AddService<T> (string)
- Adds the WebSocket service. + Adds a WebSocket service.
@@ -472,7 +472,7 @@ Broadcast (string)
- Broadcasts the specified string. + Broadcasts the specified string to all clients.
@@ -523,9 +523,9 @@ - AcceptWebSocket - (System.Net.Sockets.TcpClient)
- Accepts the WebSocket connection. + AcceptWebSocket + (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext)
+ Accepts a WebSocket connection.
@@ -534,9 +534,9 @@ - AcceptWebSocket - (System.Net.Sockets.TcpClient)
- Accepts the WebSocket connection. + AcceptWebSocket + (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext)
+ Accepts a WebSocket connection. (Inherited from WebSocketServerBase.)
@@ -548,7 +548,7 @@ Error (string)
- Occurs the WebSocketServerBase.OnError event with the specified message. + Occurs the WebSocketServerBase.OnError event with the specified string. (Inherited from WebSocketServerBase.)
@@ -613,7 +613,7 @@

WebSocketServer Constructor

- Initializes a new instance of the WebSocketServer class. + Initializes a new instance of the WebSocketSharp.Server.WebSocketServer class.

Syntax

public WebSocketServer ()
@@ -629,7 +629,7 @@

WebSocketServer Constructor

- Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the WebSocketSharp.Server.WebSocketServer class that listens for incoming connection attempts on the specified port.

Syntax

@@ -657,7 +657,7 @@

WebSocketServer Constructor

- Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the WebSocketSharp.Server.WebSocketServer class that listens for incoming connection attempts on the specified WebSocket URL.

Syntax

@@ -685,7 +685,7 @@

WebSocketServer Constructor

- Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the WebSocketSharp.Server.WebSocketServer class that listens for incoming connection attempts on the specified port and secure.

Syntax

@@ -719,7 +719,7 @@

WebSocketServer Constructor

- Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the WebSocketSharp.Server.WebSocketServer class that listens for incoming connection attempts on the specified address and port.

Syntax

@@ -731,7 +731,7 @@ address
- An System.Net.IPAddress that contains an IP address. + A System.Net.IPAddress that contains an IP address.
port @@ -753,7 +753,7 @@

WebSocketServer Constructor

- Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the WebSocketSharp.Server.WebSocketServer class that listens for incoming connection attempts on the specified address, port and secure.

Syntax

@@ -765,7 +765,7 @@ address
- An System.Net.IPAddress that contains an IP address. + A System.Net.IPAddress that contains an IP address.
port @@ -790,37 +790,37 @@ Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)
-

AcceptWebSocket Method

-
+

AcceptWebSocket Method

+

- Accepts the WebSocket connection. + Accepts a WebSocket connection.

Syntax

-
protected override void AcceptWebSocket (System.Net.Sockets.TcpClient client)
+
protected override void AcceptWebSocket (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext context)

Parameters

-
+
- client + context
- A System.Net.Sockets.TcpClient that contains the TCP connection. + A WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext that contains a WebSocket connection.

Remarks

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

Requirements

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

AddService<T> Generic Method

- Adds the WebSocket service. + Adds a WebSocket service.

Syntax

public void AddService<T> (string absPath)
where T : WebSocketSharp.Server.WebSocketService, new()
@@ -831,7 +831,7 @@ T
- The type of the WebSocket service. The T must inherit the WebSocketSharp.Server.WebSocketService class. + The type of a WebSocket service. The T must inherit the WebSocketSharp.Server.WebSocketService class.
@@ -842,7 +842,7 @@ absPath
- A string that contains an absolute path associated with the WebSocket service. + A string that contains an absolute path associated with a WebSocket service.
@@ -858,7 +858,7 @@

Broadcast Method

- Broadcasts the specified string. + Broadcasts the specified string to all clients.

Syntax

public void Broadcast (string data)
@@ -882,23 +882,23 @@ Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)
-

ServicePath Property

-
+

ServicePaths Property

+

- Gets the service paths. + Gets the paths associated with the each WebSocket services.

Syntax

-
public IEnumerable<string> ServicePath { get; }
+
public IEnumerable<string> ServicePaths { get; }

Value

-
- An IEnumerable<string> that contains the service paths. +
+ An IEnumerable<string> that contains the paths.

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/WebSocketServerBase.html b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServerBase.html index 761ff628..58472219 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServerBase.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServerBase.html @@ -296,7 +296,7 @@ System.Net.IPAddress . - Gets the local IP address on which to listen for incoming connection attempts. + Gets the IP address on which to listen for incoming connection attempts. @@ -310,7 +310,7 @@ bool . - Gets a value indicating whether this server is secure. + Gets a value indicating whether this server provides secure connection. @@ -409,9 +409,9 @@ - AcceptWebSocket - (System.Net.Sockets.TcpClient)
- Accepts the WebSocket connection. + AcceptWebSocket + (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext)
+ Accepts a WebSocket connection.
@@ -423,7 +423,7 @@ Error (string)
- Occurs the WebSocketServerBase.OnError event with the specified message. + Occurs the WebSocketServerBase.OnError event with the specified string.
@@ -569,7 +569,7 @@ address
- An System.Net.IPAddress that contains a local IP address. + A System.Net.IPAddress that contains an IP address.
port @@ -581,7 +581,7 @@ absPath
- A string that contains a absolute path. + A string that contains an absolute path.
secure @@ -633,43 +633,43 @@ Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)
-

AcceptWebSocket Method

-
+

AcceptWebSocket Method

+

- Accepts the WebSocket connection. + Accepts a WebSocket connection.

Syntax

-
protected abstract void AcceptWebSocket (System.Net.Sockets.TcpClient client)
+
protected abstract void AcceptWebSocket (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext context)

Parameters

-
+
- client + context
- A System.Net.Sockets.TcpClient that contains the WebSocket connection. + A WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext that contains a WebSocket connection.

Remarks

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

Requirements

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

Address Property

- Gets the local IP address on which to listen for incoming connection attempts. + Gets the IP address on which to listen for incoming connection attempts.

Syntax

public System.Net.IPAddress Address { get; }

Value

- A System.Net.IPAddress that contains a local IP address. + A System.Net.IPAddress that contains an IP address.

Remarks

@@ -703,7 +703,7 @@

Error Method

- Occurs the WebSocketServerBase.OnError event with the specified message. + Occurs the WebSocketServerBase.OnError event with the specified string.

Syntax

protected virtual void Error (string message)
@@ -730,13 +730,13 @@

IsSecure Property

- Gets a value indicating whether this server is secure. + Gets a value indicating whether this server provides secure connection.

Syntax

public bool IsSecure { get; }

Value

- true if this server is secure; otherwise, false. + true if this server provides secure connection; otherwise, false.

Remarks

diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketService.html b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketService.html index ed5c0094..9d583ec0 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketService.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketService.html @@ -207,8 +207,8 @@

WebSocketService Class

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

+ Provides the basic functions of the WebSocket service. +

Syntax

public abstract class WebSocketService
@@ -216,8 +216,8 @@

Remarks

- Documentation for this section has not yet been entered. -
+ The WebSocketService class is an abstract class. +

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)
@@ -243,8 +243,8 @@ ()
- Documentation for this section has not yet been entered. - + Initializes a new instance of the WebSocketSharp.Server.WebSocketService class. +
@@ -263,7 +263,9 @@ string - . Documentation for this section has not yet been entered. + . + Gets the ID of a WebSocketSharp.Server.WebSocketService instance. + [read-only]
@@ -275,7 +277,9 @@ bool - . Documentation for this section has not yet been entered. + . + Gets a value indicating whether a WebSocketSharp.Server.WebSocketService instance is bound to a WebSocketSharp.WebSocket. + @@ -294,7 +298,9 @@ System.Collections.Specialized.NameValueCollection - . Documentation for this section has not yet been entered. + . + Gets the HTTP query string variables used in the WebSocket opening handshake. + [read-only]
@@ -306,7 +312,9 @@ SessionManager - . Documentation for this section has not yet been entered. + . + Gets the sessions to the WebSocket service. + @@ -323,7 +331,10 @@ Bind - (WebSocketSharp.WebSocket, SessionManager)
Documentation for this section has not yet been entered.
+ (WebSocketSharp.WebSocket, SessionManager)
+ Binds the specified WebSocketSharp.WebSocket and WebSocketSharp.Server.SessionManager + to a WebSocketSharp.Server.WebSocketService instance. +
@@ -332,8 +343,10 @@ - Ping - () : bool
Documentation for this section has not yet been entered.
+ Broadcast + (byte[])
+ Broadcasts the specified array of byte to all clients of the WebSocket service. +
@@ -342,8 +355,10 @@ - Ping - (string) : bool
Documentation for this section has not yet been entered.
+ Broadcast + (string)
+ Broadcasts the specified string to all clients of the WebSocket service. +
@@ -352,8 +367,10 @@ - PingAround - () : Dictionary<string, bool>
Documentation for this section has not yet been entered.
+ Broadping + () : Dictionary<string, bool>
+ Pings to all clients of the WebSocket service. +
@@ -362,8 +379,10 @@ - PingAround - (string) : Dictionary<string, bool>
Documentation for this section has not yet been entered.
+ Broadping + (string) : Dictionary<string, bool>
+ Pings with the specified string to all clients of the WebSocket service. +
@@ -372,8 +391,10 @@ - PingTo - (string) : bool
Documentation for this section has not yet been entered.
+ Ping + () : bool
+ Pings to the client of a WebSocketSharp.Server.WebSocketService instance. +
@@ -382,8 +403,10 @@ - PingTo - (string, string) : bool
Documentation for this section has not yet been entered.
+ Ping + (string) : bool
+ Pings with the specified string to the client of a WebSocketSharp.Server.WebSocketService instance. +
@@ -392,8 +415,10 @@ - Publish - (byte[])
Documentation for this section has not yet been entered.
+ PingTo + (string) : bool
+ Pings to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID. +
@@ -402,8 +427,11 @@ - Publish - (string)
Documentation for this section has not yet been entered.
+ PingTo + (string, string) : bool
+ Pings with the specified string to the client of a WebSocketSharp.Server.WebSocketService instance + associated with the specified ID. +
@@ -413,7 +441,9 @@ Send - (byte[])
Documentation for this section has not yet been entered.
+ (byte[])
+ Sends a binary data to the client of a WebSocketSharp.Server.WebSocketService instance. +
@@ -423,7 +453,9 @@ Send - (string)
Documentation for this section has not yet been entered.
+ (string)
+ Sends a text data to the client of a WebSocketSharp.Server.WebSocketService instance. +
@@ -433,7 +465,9 @@ SendTo - (string, byte[])
Documentation for this section has not yet been entered.
+ (string, byte[])
+ Sends a binary data to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID. +
@@ -443,7 +477,9 @@ SendTo - (string, string)
Documentation for this section has not yet been entered.
+ (string, string)
+ Sends a text data to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID. +
@@ -453,7 +489,9 @@ Start - ()
Documentation for this section has not yet been entered.
+ ()
+ Starts a WebSocketSharp.Server.WebSocketService instance. +
@@ -463,7 +501,9 @@ Stop - ()
Documentation for this section has not yet been entered.
+ ()
+ Stops a WebSocketSharp.Server.WebSocketService instance. +
@@ -473,7 +513,9 @@ Stop - (ushort, string)
Documentation for this section has not yet been entered.
+ (ushort, string)
+ Stops a WebSocketSharp.Server.WebSocketService instance with the specified ushort and string. +
@@ -483,7 +525,9 @@ Stop - (WebSocketSharp.CloseStatusCode, string)
Documentation for this section has not yet been entered.
+ (WebSocketSharp.CloseStatusCode, string)
+ Stops a WebSocketSharp.Server.WebSocketService instance with the specified WebSocketSharp.CloseStatusCode and string. +
@@ -499,8 +543,10 @@ - OnClose - (object, WebSocketSharp.CloseEventArgs)
Documentation for this section has not yet been entered.
+ OnClose + (WebSocketSharp.CloseEventArgs)
+ Occurs when a inner WebSocketSharp.WebSocket receives a Close frame or the Stop method is called. +
@@ -509,8 +555,10 @@ - OnError - (object, WebSocketSharp.ErrorEventArgs)
Documentation for this section has not yet been entered.
+ OnError + (WebSocketSharp.ErrorEventArgs)
+ Occurs when a inner WebSocketSharp.WebSocket gets an error. +
@@ -519,8 +567,10 @@ - OnMessage - (object, WebSocketSharp.MessageEventArgs)
Documentation for this section has not yet been entered.
+ OnMessage + (WebSocketSharp.MessageEventArgs)
+ Occurs when a inner WebSocketSharp.WebSocket receives a data frame. +
@@ -529,8 +579,10 @@ - OnOpen - (object, EventArgs)
Documentation for this section has not yet been entered.
+ OnOpen + ()
+ Occurs when the WebSocket connection has been established. +
@@ -573,8 +625,8 @@

WebSocketService Constructor

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

+ Initializes a new instance of the WebSocketSharp.Server.WebSocketService class. +

Syntax

public WebSocketService ()

Remarks

@@ -589,8 +641,9 @@

Bind Method

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

+ Binds the specified WebSocketSharp.WebSocket and WebSocketSharp.Server.SessionManager + to a WebSocketSharp.Server.WebSocketService instance. +

Syntax

public void Bind (WebSocketSharp.WebSocket socket, SessionManager sessions)

Parameters

@@ -600,14 +653,14 @@ socket
- Documentation for this section has not yet been entered. -
+ A WebSocketSharp.WebSocket to bind to the WebSocketService. +
sessions
- Documentation for this section has not yet been entered. -
+ A WebSocketSharp.Server.SessionManager to bind to the WebSocketService. +

Remarks

@@ -619,17 +672,124 @@ Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)
+

Broadcast Method

+
+

+ Broadcasts the specified array of byte to all clients of the WebSocket service. +

+

Syntax

+
public void Broadcast (byte[] data)
+

Parameters

+
+
+
+ data +
+
+ An array of byte to broadcast. +
+
+
+

Remarks

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

Requirements

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

Broadcast Method

+
+

+ Broadcasts the specified string to all clients of the WebSocket service. +

+

Syntax

+
public void Broadcast (string data)
+

Parameters

+
+
+
+ data +
+
+ A string to broadcast. +
+
+
+

Remarks

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

Requirements

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

Broadping Method

+
+

+ Pings to all clients of the WebSocket service. +

+

Syntax

+
public Dictionary<string, bool> Broadping ()
+

Returns

+
+ A Dictionary<string, bool> that contains the collection of the ID and value + indicating whether the WebSocket service received a Pong in a time. +
+

Remarks

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

Requirements

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

Broadping Method

+
+

+ Pings with the specified string to all clients of the WebSocket service. +

+

Syntax

+
public Dictionary<string, bool> Broadping (string message)
+

Parameters

+
+
+
+ message +
+
+ A string that contains a message. +
+
+
+

Returns

+
+ A Dictionary<string, bool> that contains the collection of the ID and value + indicating whether the WebSocket service received a Pong in a time. +
+

Remarks

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

Requirements

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

ID Property

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

+ Gets the ID of a WebSocketSharp.Server.WebSocketService instance. +

Syntax

public string ID { get; }

Value

- Documentation for this section has not yet been entered. -
+ A string that contains a ID. +

Remarks

Documentation for this section has not yet been entered. @@ -642,14 +802,14 @@

IsBound Property

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

+ Gets a value indicating whether a WebSocketSharp.Server.WebSocketService instance is bound to a WebSocketSharp.WebSocket. +

Syntax

public bool IsBound { get; }

Value

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

Remarks

Documentation for this section has not yet been entered. @@ -659,149 +819,114 @@ Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

-

OnClose Method

-
+

OnClose Method

+

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

+ Occurs when a inner WebSocketSharp.WebSocket receives a Close frame or the Stop method is called. +

Syntax

-
protected virtual void OnClose (object sender, WebSocketSharp.CloseEventArgs e)
+
protected virtual void OnClose (WebSocketSharp.CloseEventArgs e)

Parameters

-
+
-
- sender -
-
- Documentation for this section has not yet been entered. -
e
- Documentation for this section has not yet been entered. -
+ A WebSocketSharp.CloseEventArgs that contains the event data associated with a WebSocketSharp.WebSocket.OnClose event. +

Remarks

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

Requirements

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

-

OnError Method

-
+

OnError Method

+

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

+ Occurs when a inner WebSocketSharp.WebSocket gets an error. +

Syntax

-
protected virtual void OnError (object sender, WebSocketSharp.ErrorEventArgs e)
+
protected virtual void OnError (WebSocketSharp.ErrorEventArgs e)

Parameters

-
+
-
- sender -
-
- Documentation for this section has not yet been entered. -
e
- Documentation for this section has not yet been entered. -
+ An WebSocketSharp.ErrorEventArgs that contains the event data associated with a WebSocketSharp.WebSocket.OnError event. +

Remarks

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

Requirements

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

-

OnMessage Method

-
+

OnMessage Method

+

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

+ Occurs when a inner WebSocketSharp.WebSocket receives a data frame. +

Syntax

-
protected virtual void OnMessage (object sender, WebSocketSharp.MessageEventArgs e)
+
protected virtual void OnMessage (WebSocketSharp.MessageEventArgs e)

Parameters

-
+
-
- sender -
-
- Documentation for this section has not yet been entered. -
e
- Documentation for this section has not yet been entered. -
+ A WebSocketSharp.MessageEventArgs that contains the event data associated with a WebSocketSharp.WebSocket.OnMessage event. +

Remarks

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

Requirements

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

-

OnOpen Method

-
+

OnOpen Method

+

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

+ Occurs when the WebSocket connection has been established. +

Syntax

-
protected virtual void OnOpen (object sender, EventArgs e)
-

Parameters

-
-
-
- sender -
-
- Documentation for this section has not yet been entered. -
-
- e -
-
- Documentation for this section has not yet been entered. -
-
-
+
protected virtual void OnOpen ()

Remarks

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

Requirements

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

Ping Method

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

+ Pings to the client of a WebSocketSharp.Server.WebSocketService instance. +

Syntax

public bool Ping ()

Returns

- Documentation for this section has not yet been entered. -
+ true if the WebSocketService receives a Pong in a time; otherwise, false. +

Remarks

Documentation for this section has not yet been entered. @@ -814,8 +939,8 @@

Ping Method

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

+ Pings with the specified string to the client of a WebSocketSharp.Server.WebSocketService instance. +

Syntax

public bool Ping (string message)

Parameters

@@ -825,14 +950,14 @@ message
- Documentation for this section has not yet been entered. -
+ A string that contains a message. +

Returns

- Documentation for this section has not yet been entered. -
+ true if the WebSocketService receives a Pong in a time; otherwise, false. +

Remarks

Documentation for this section has not yet been entered. @@ -842,62 +967,11 @@ Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

-

PingAround Method

-
-

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

-

Syntax

-
public Dictionary<string, bool> PingAround ()
-

Returns

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

Remarks

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

Requirements

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

PingAround Method

-
-

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

-

Syntax

-
public Dictionary<string, bool> PingAround (string message)
-

Parameters

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

Returns

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

Remarks

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

Requirements

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

PingTo Method

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

+ Pings to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID. +

Syntax

public bool PingTo (string id)

Parameters

@@ -907,14 +981,14 @@ id
- Documentation for this section has not yet been entered. -
+ A string that contains a ID that represents the destination for the Ping. +

Returns

- Documentation for this section has not yet been entered. -
+ true if the WebSocket service receives a Pong in a time; otherwise, false. +

Remarks

Documentation for this section has not yet been entered. @@ -927,8 +1001,9 @@

PingTo Method

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

+ Pings with the specified string to the client of a WebSocketSharp.Server.WebSocketService instance + associated with the specified ID. +

Syntax

public bool PingTo (string id, string message)

Parameters

@@ -938,20 +1013,20 @@ id
- Documentation for this section has not yet been entered. -
+ A string that contains a ID that represents the destination for the Ping. +
message
- Documentation for this section has not yet been entered. -
+ A string that contains a message. +

Returns

- Documentation for this section has not yet been entered. -
+ true if the WebSocketService receives a Pong in a time; otherwise, false. +

Remarks

Documentation for this section has not yet been entered. @@ -961,71 +1036,17 @@ Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

-

Publish Method

-
-

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

-

Syntax

-
public void Publish (byte[] data)
-

Parameters

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

Remarks

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

Requirements

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

Publish Method

-
-

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

-

Syntax

-
public void Publish (string data)
-

Parameters

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

Remarks

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

Requirements

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

QueryString Property

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

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

Syntax

Value

- Documentation for this section has not yet been entered. -
+ A System.Collections.Specialized.NameValueCollection that contains the query string variables. +

Remarks

Documentation for this section has not yet been entered. @@ -1038,8 +1059,8 @@

Send Method

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

+ Sends a binary data to the client of a WebSocketSharp.Server.WebSocketService instance. +

Syntax

public void Send (byte[] data)

Parameters

@@ -1049,8 +1070,8 @@ data
- Documentation for this section has not yet been entered. -
+ An array of byte that contains a binary data to send. +

Remarks

@@ -1065,8 +1086,8 @@

Send Method

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

+ Sends a text data to the client of a WebSocketSharp.Server.WebSocketService instance. +

Syntax

public void Send (string data)

Parameters

@@ -1076,8 +1097,8 @@ data
- Documentation for this section has not yet been entered. -
+ A string that contains a text data to send. +

Remarks

@@ -1092,8 +1113,8 @@

SendTo Method

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

+ Sends a binary data to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID. +

Syntax

public void SendTo (string id, byte[] data)

Parameters

@@ -1103,14 +1124,14 @@ id
- Documentation for this section has not yet been entered. -
+ A string that contains a ID that represents the destination for the data. +
data
- Documentation for this section has not yet been entered. -
+ An array of byte that contains a binary data to send. +

Remarks

@@ -1125,8 +1146,8 @@

SendTo Method

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

+ Sends a text data to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID. +

Syntax

public void SendTo (string id, string data)

Parameters

@@ -1136,14 +1157,14 @@ id
- Documentation for this section has not yet been entered. -
+ A string that contains a ID that represents the destination for the data. +
data
- Documentation for this section has not yet been entered. -
+ A string that contains a text data to send. +

Remarks

@@ -1158,14 +1179,14 @@

Sessions Property

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

+ Gets the sessions to the WebSocket service. +

Syntax

protected SessionManager Sessions { get; }

Value

- Documentation for this section has not yet been entered. -
+ A WebSocketSharp.Server.SessionManager that contains the sessions to the WebSocket service. +

Remarks

Documentation for this section has not yet been entered. @@ -1178,8 +1199,8 @@

Start Method

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

+ Starts a WebSocketSharp.Server.WebSocketService instance. +

Syntax

public void Start ()

Remarks

@@ -1194,8 +1215,8 @@

Stop Method

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

+ Stops a WebSocketSharp.Server.WebSocketService instance. +

Syntax

public void Stop ()

Remarks

@@ -1210,8 +1231,8 @@

Stop Method

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

+ Stops a WebSocketSharp.Server.WebSocketService instance with the specified ushort and string. +

Syntax

public void Stop (ushort code, string reason)

Parameters

@@ -1221,14 +1242,14 @@ code
- Documentation for this section has not yet been entered. -
+ A ushort that contains a status code indicating the reason for stop. +
reason
- Documentation for this section has not yet been entered. -
+ A string that contains a reason for stop. +

Remarks

@@ -1243,8 +1264,8 @@

Stop Method

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

+ Stops a WebSocketSharp.Server.WebSocketService instance with the specified WebSocketSharp.CloseStatusCode and string. +

Syntax

public void Stop (WebSocketSharp.CloseStatusCode code, string reason)

Parameters

@@ -1254,14 +1275,14 @@ code
- Documentation for this section has not yet been entered. -
+ One of the WebSocketSharp.CloseStatusCode values that contains a status code indicating the reason for stop. +
reason
- Documentation for this section has not yet been entered. -
+ A string that contains a reason for stop. +

Remarks

diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceHost`1.html b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceHost`1.html index 0019fb00..0f706268 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceHost`1.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceHost`1.html @@ -227,7 +227,7 @@

Remarks

- The WebSocketServiceHost<T> class provides single WebSocket service. + The WebSocketServiceHost<T> class provides the single WebSocket service.

Requirements

@@ -372,7 +372,7 @@ System.Net.IPAddress . - Gets the local IP address on which to listen for incoming connection attempts. + Gets the IP address on which to listen for incoming connection attempts. (Inherited from WebSocketServerBase.) @@ -386,7 +386,7 @@ bool . - Gets a value indicating whether this server is secure. + Gets a value indicating whether this server provides secure connection. (Inherited from WebSocketServerBase.) @@ -488,7 +488,7 @@ Broadcast (string)
- Broadcasts the specified string. + Broadcasts the specified string to all clients.
@@ -551,9 +551,9 @@ - AcceptWebSocket - (System.Net.Sockets.TcpClient)
- Accepts the WebSocket connection. + AcceptWebSocket + (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext)
+ Accepts a WebSocket connection.
@@ -562,9 +562,9 @@ - AcceptWebSocket - (System.Net.Sockets.TcpClient)
- Accepts the WebSocket connection. + AcceptWebSocket + (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext)
+ Accepts a WebSocket connection. (Inherited from WebSocketServerBase.)
@@ -576,7 +576,7 @@ Error (string)
- Occurs the WebSocketServerBase.OnError event with the specified message. + Occurs the WebSocketServerBase.OnError event with the specified string. (Inherited from WebSocketServerBase.)
@@ -838,7 +838,7 @@ address
- An System.Net.IPAddress that contains an IP address. + A System.Net.IPAddress that contains an IP address.
port @@ -878,7 +878,7 @@ address
- An System.Net.IPAddress that contains an IP address. + A System.Net.IPAddress that contains an IP address.
port @@ -909,37 +909,37 @@ Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

-

AcceptWebSocket Method

-
+

AcceptWebSocket Method

+

- Accepts the WebSocket connection. + Accepts a WebSocket connection.

Syntax

-
protected override void AcceptWebSocket (System.Net.Sockets.TcpClient client)
+
protected override void AcceptWebSocket (WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext context)

Parameters

-
+
- client + context
- A System.Net.Sockets.TcpClient that contains the TCP connection. + A WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext that contains a WebSocket connection.

Remarks

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

Requirements

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

Broadcast Method

- Broadcasts the specified string. + Broadcasts the specified string to all clients.

Syntax

public void Broadcast (string data)
@@ -983,8 +983,9 @@

Returns

- Documentation for this section has not yet been entered. -
+ A Dictionary<string, bool> that contains the collection of the session ID and value + indicating whether the server received a Pong in a time. +

Remarks

Documentation for this section has not yet been entered. diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/index.html b/websocket-sharp/doc/html/WebSocketSharp.Server/index.html index 57a39a92..40222c13 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/index.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/index.html @@ -263,8 +263,8 @@ WebSocketService - Documentation for this section has not yet been entered. - + Provides the basic functions of the WebSocket service. + diff --git a/websocket-sharp/doc/html/WebSocketSharp/Ext.html b/websocket-sharp/doc/html/WebSocketSharp/Ext.html index 4e82527a..82ce2f84 100644 --- a/websocket-sharp/doc/html/WebSocketSharp/Ext.html +++ b/websocket-sharp/doc/html/WebSocketSharp/Ext.html @@ -237,9 +237,20 @@ - AcceptWebSocket - (this System.Net.Sockets.TcpClient, bool) : WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext
- Accept a WebSocket connection by the System.Net.Sockets.TcpListener. + AcceptWebSocket + (this System.Net.Sockets.TcpListener, bool) : WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext
+ Accepts a WebSocket connection by the System.Net.Sockets.TcpListener. +
+ + + +
static
+ + + + AcceptWebSocketAsync + (this System.Net.Sockets.TcpListener, bool, Action<WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext>)
+ Accepts a WebSocket connection asynchronously by the System.Net.Sockets.TcpListener.
@@ -704,21 +715,21 @@

Member Details

-

AcceptWebSocket Method

-
+

AcceptWebSocket Method

+

- Accept a WebSocket connection by the System.Net.Sockets.TcpListener. + Accepts a WebSocket connection by the System.Net.Sockets.TcpListener.

Syntax

- +

Parameters

-
+
- client + listener
- A System.Net.Sockets.TcpClient that contains a TCP connection to accept a WebSocket connection from. + A System.Net.Sockets.TcpListener that provides a TCP connection to accept a WebSocket connection.
secure @@ -729,11 +740,67 @@

Returns

-
+
A WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext that contains a WebSocket connection.

Exceptions

-
+
+ + + + + + + + + +
TypeReason
+ ArgumentNullException + + listener is null. +
+
+

Remarks

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

Requirements

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

AcceptWebSocketAsync Method

+
+

+ Accepts a WebSocket connection asynchronously by the System.Net.Sockets.TcpListener. +

+

Syntax

+
public static void AcceptWebSocketAsync (this System.Net.Sockets.TcpListener listener, bool secure, Action<WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext> completed)
+

Parameters

+
+
+
+ listener +
+
+ A System.Net.Sockets.TcpListener that provides a TCP connection to accept a WebSocket connection. +
+
+ secure +
+
+ A bool that indicates a secure connection or not. (true indicates a secure connection.) +
+
+ completed +
+
+ An Action<TcpListenerWebSocketContext> delegate that contains the method(s) that is called when an asynchronous operation completes. +
+
+
+

Exceptions

+
@@ -744,17 +811,17 @@ ArgumentNullException
Type - Is thrown when the client parameter passed to a method is invalid because it is null. + listener is null.

Remarks

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

Requirements

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

diff --git a/websocket-sharp/doc/html/WebSocketSharp/WebSocket.html b/websocket-sharp/doc/html/WebSocketSharp/WebSocket.html index 14e6f284..7cef1b19 100644 --- a/websocket-sharp/doc/html/WebSocketSharp/WebSocket.html +++ b/websocket-sharp/doc/html/WebSocketSharp/WebSocket.html @@ -837,7 +837,7 @@ code
- A Frame.CloseStatusCode that contains a status code indicating a reason for closure. + A WebSocketSharp.CloseStatusCode that contains a status code indicating a reason for closure.
@@ -897,7 +897,7 @@ code
- A Frame.CloseStatusCode that contains a status code indicating a reason for closure. + A WebSocketSharp.CloseStatusCode that contains a status code indicating a reason for closure.
reason @@ -1180,7 +1180,7 @@ data
- An array of byte that contains the binary data to be sent. + An array of byte that contains a binary data to send.
@@ -1207,7 +1207,7 @@ file
- A System.IO.FileInfo that contains the binary data to be sent. + A System.IO.FileInfo that contains a binary data to send.
@@ -1234,7 +1234,7 @@ data
- A string that contains the text data to be sent. + A string that contains a text data to send.
@@ -1261,7 +1261,7 @@ data
- An array of byte that contains the binary data to be sent. + An array of byte that contains a binary data to send.
completed @@ -1294,7 +1294,7 @@ file
- A System.IO.FileInfo that contains the binary data to be sent. + A System.IO.FileInfo that contains a binary data to send.
completed @@ -1327,7 +1327,7 @@ data
- A string that contains the text data to be sent. + A string that contains a text data to send.
completed diff --git a/websocket-sharp/doc/html/index.html b/websocket-sharp/doc/html/index.html index fcaa3c3e..7c8714bb 100644 --- a/websocket-sharp/doc/html/index.html +++ b/websocket-sharp/doc/html/index.html @@ -511,8 +511,8 @@ WebSocketService - Documentation for this section has not yet been entered. - + Provides the basic functions of the WebSocket service. + diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServer.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServer.xml index e948664f..c7e6b982 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServer.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServer.xml @@ -13,7 +13,7 @@ Provides the functions of the server that receives the WebSocket connection requests. - The WebSocketServer class provides multi WebSocket service. + The WebSocketServer class provides the multi WebSocket service. @@ -24,7 +24,7 @@ - Initializes a new instance of the WebSocketServer class. + Initializes a new instance of the class. To be added. @@ -41,7 +41,7 @@ An that contains a port number. - Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the class that listens for incoming connection attempts on the specified . To be added. @@ -59,7 +59,7 @@ A that contains a WebSocket URL. - Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the class that listens for incoming connection attempts on the specified WebSocket URL. To be added. @@ -81,7 +81,7 @@ A that indicates providing a secure connection or not. (true indicates providing a secure connection.) - Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the class that listens for incoming connection attempts on the specified and . To be added. @@ -97,13 +97,13 @@ - An that contains an IP address. + A that contains an IP address. An that contains a port number. - Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the class that listens for incoming connection attempts on the specified and . To be added. @@ -120,7 +120,7 @@ - An that contains an IP address. + A that contains an IP address. An that contains a port number. @@ -129,28 +129,28 @@ A that indicates providing a secure connection or not. (true indicates providing a secure connection.) - Initializes a new instance of the WebSocketServer class that listens for incoming connection attempts + Initializes a new instance of the class that listens for incoming connection attempts on the specified , and . To be added. - - + + Method System.Void - + - - A that contains the TCP connection. + + A that contains a WebSocket connection. - Accepts the WebSocket connection. + Accepts a WebSocket connection. To be added. @@ -175,13 +175,13 @@ - The type of the WebSocket service. The T must inherit the class. + The type of a WebSocket service. The T must inherit the class. - A that contains an absolute path associated with the WebSocket service. + A that contains an absolute path associated with a WebSocket service. - Adds the WebSocket service. + Adds a WebSocket service. To be added. @@ -201,24 +201,24 @@ A to broadcast. - Broadcasts the specified . + Broadcasts the specified to all clients. To be added. - - - + + + Property System.Collections.Generic.IEnumerable<System.String> - Gets the service paths. + Gets the paths associated with the each WebSocket services. - An IEnumerable<string> that contains the service paths. + An IEnumerable<string> that contains the paths. To be added. diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServerBase.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServerBase.xml index 60630d04..a539e1af 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServerBase.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServerBase.xml @@ -65,13 +65,13 @@ - An that contains a local IP address. + A that contains an IP address. An that contains a port number. - A that contains a absolute path. + A that contains an absolute path. A that indicates providing a secure connection or not. (true indicates providing a secure connection.) @@ -98,21 +98,21 @@ - - + + Method System.Void - + - - A that contains the WebSocket connection. + + A that contains a WebSocket connection. - Accepts the WebSocket connection. + Accepts a WebSocket connection. To be added. @@ -126,10 +126,10 @@ - Gets the local IP address on which to listen for incoming connection attempts. + Gets the IP address on which to listen for incoming connection attempts. - A that contains a local IP address. + A that contains an IP address. To be added. @@ -166,7 +166,7 @@ A that contains an error message. - Occurs the event with the specified . + Occurs the event with the specified . To be added. @@ -180,10 +180,10 @@ - Gets a value indicating whether this server is secure. + Gets a value indicating whether this server provides secure connection. - true if this server is secure; otherwise, false. + true if this server provides secure connection; otherwise, false. To be added. diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketService.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketService.xml index e4b4e75f..30fd92e0 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketService.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketService.xml @@ -9,8 +9,12 @@ - To be added. - To be added. + + Provides the basic functions of the WebSocket service. + + + The WebSocketService class is an abstract class. + @@ -19,7 +23,9 @@ Constructor - To be added. + + Initializes a new instance of the class. + To be added. @@ -35,9 +41,99 @@ - To be added. - To be added. - To be added. + + A to bind to the WebSocketService. + + + A to bind to the WebSocketService. + + + Binds the specified and + to a instance. + + To be added. + + + + + + Method + + System.Void + + + + + + + An array of to broadcast. + + + Broadcasts the specified array of to all clients of the WebSocket service. + + To be added. + + + + + + Method + + System.Void + + + + + + + A to broadcast. + + + Broadcasts the specified to all clients of the WebSocket service. + + To be added. + + + + + + Method + + System.Collections.Generic.Dictionary<System.String,System.Boolean> + + + + + Pings to all clients of the WebSocket service. + + + A Dictionary<string, bool> that contains the collection of the ID and value + indicating whether the WebSocket service received a Pong in a time. + + To be added. + + + + + + Method + + System.Collections.Generic.Dictionary<System.String,System.Boolean> + + + + + + + A that contains a message. + + + Pings with the specified to all clients of the WebSocket service. + + + A Dictionary<string, bool> that contains the collection of the ID and value + indicating whether the WebSocket service received a Pong in a time. + To be added. @@ -49,8 +145,12 @@ System.String - To be added. - To be added. + + Gets the ID of a instance. + + + A that contains a ID. + To be added. @@ -62,80 +162,87 @@ System.Boolean - To be added. - To be added. + + Gets a value indicating whether a instance is bound to a . + + + true if the WebSocketService is bound to a WebSocket; otherwise, false. + To be added. - - + + Method System.Void - - To be added. - To be added. - To be added. + + A that contains the event data associated with a event. + + + Occurs when a inner receives a Close frame or the Stop method is called. + To be added. - - + + Method System.Void - - To be added. - To be added. - To be added. + + An that contains the event data associated with a event. + + + Occurs when a inner gets an error. + To be added. - - + + Method System.Void - - To be added. - To be added. - To be added. + + A that contains the event data associated with a event. + + + Occurs when a inner receives a data frame. + To be added. - - + + Method System.Void - - - - + - To be added. - To be added. - To be added. + + Occurs when the WebSocket connection has been established. + To be added. @@ -148,8 +255,12 @@ - To be added. - To be added. + + Pings to the client of a instance. + + + true if the WebSocketService receives a Pong in a time; otherwise, false. + To be added. @@ -164,40 +275,15 @@ - To be added. - To be added. - To be added. - To be added. - - - - - - Method - - System.Collections.Generic.Dictionary<System.String,System.Boolean> - - - - To be added. - To be added. - To be added. - - - - - - Method - - System.Collections.Generic.Dictionary<System.String,System.Boolean> - - - - - - To be added. - To be added. - To be added. + + A that contains a message. + + + Pings with the specified to the client of a instance. + + + true if the WebSocketService receives a Pong in a time; otherwise, false. + To be added. @@ -212,9 +298,15 @@ - To be added. - To be added. - To be added. + + A that contains a ID that represents the destination for the Ping. + + + Pings to the client of a instance associated with the specified ID. + + + true if the WebSocket service receives a Pong in a time; otherwise, false. + To be added. @@ -230,42 +322,19 @@ - To be added. - To be added. - To be added. - To be added. - To be added. - - - - - - Method - - System.Void - - - - - - To be added. - To be added. - To be added. - - - - - - Method - - System.Void - - - - - - To be added. - To be added. + + A that contains a ID that represents the destination for the Ping. + + + A that contains a message. + + + Pings with the specified to the client of a instance + associated with the specified ID. + + + true if the WebSocketService receives a Pong in a time; otherwise, false. + To be added. @@ -277,8 +346,12 @@ System.Collections.Specialized.NameValueCollection - To be added. - To be added. + + Gets the HTTP query string variables used in the WebSocket opening handshake. + + + A that contains the query string variables. + To be added. @@ -293,8 +366,12 @@ - To be added. - To be added. + + An array of that contains a binary data to send. + + + Sends a binary data to the client of a instance. + To be added. @@ -309,8 +386,12 @@ - To be added. - To be added. + + A that contains a text data to send. + + + Sends a text data to the client of a instance. + To be added. @@ -326,9 +407,15 @@ - To be added. - To be added. - To be added. + + A that contains a ID that represents the destination for the data. + + + An array of that contains a binary data to send. + + + Sends a binary data to the client of a instance associated with the specified ID. + To be added. @@ -344,9 +431,15 @@ - To be added. - To be added. - To be added. + + A that contains a ID that represents the destination for the data. + + + A that contains a text data to send. + + + Sends a text data to the client of a instance associated with the specified ID. + To be added. @@ -358,8 +451,12 @@ WebSocketSharp.Server.SessionManager - To be added. - To be added. + + Gets the sessions to the WebSocket service. + + + A that contains the sessions to the WebSocket service. + To be added. @@ -372,7 +469,9 @@ - To be added. + + Starts a instance. + To be added. @@ -385,7 +484,9 @@ - To be added. + + Stops a instance. + To be added. @@ -401,9 +502,15 @@ - To be added. - To be added. - To be added. + + A that contains a status code indicating the reason for stop. + + + A that contains a reason for stop. + + + Stops a instance with the specified and . + To be added. @@ -419,9 +526,15 @@ - To be added. - To be added. - To be added. + + One of the values that contains a status code indicating the reason for stop. + + + A that contains a reason for stop. + + + Stops a instance with the specified and . + 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 30571ce2..719a4f21 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServiceHost`1.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServiceHost`1.xml @@ -28,7 +28,7 @@ Provides the functions of the server that receives the WebSocket connection requests. - The WebSocketServiceHost<T> class provides single WebSocket service. + The WebSocketServiceHost<T> class provides the single WebSocket service. @@ -149,7 +149,7 @@ - An that contains an IP address. + A that contains an IP address. An that contains a port number. @@ -176,7 +176,7 @@ - An that contains an IP address. + A that contains an IP address. An that contains a port number. @@ -195,21 +195,21 @@ - - + + Method System.Void - + - - A that contains the TCP connection. + + A that contains a WebSocket connection. - Accepts the WebSocket connection. + Accepts a WebSocket connection. To be added. @@ -229,7 +229,7 @@ A to broadcast. - Broadcasts the specified . + Broadcasts the specified to all clients. To be added. @@ -251,7 +251,10 @@ Pings with the specified to all clients. - To be added. + + A Dictionary<string, bool> that contains the collection of the session ID and value + indicating whether the server received a Pong in a time. + To be added. diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp/Ext.xml b/websocket-sharp/doc/mdoc/WebSocketSharp/Ext.xml index 23c5eacb..ee90615f 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp/Ext.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp/Ext.xml @@ -16,32 +16,63 @@ - - + + Method WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext - + - - A that contains a TCP connection to accept a WebSocket connection from. + + A that provides a TCP connection to accept a WebSocket connection. A that indicates a secure connection or not. (true indicates a secure connection.) - Accept a WebSocket connection by the . + Accepts a WebSocket connection by the . A that contains a WebSocket connection. To be added. - Is thrown when the parameter passed to a method is invalid because it is . + is . + + + + + + + Method + + System.Void + + + + + + + + + A that provides a TCP connection to accept a WebSocket connection. + + + A that indicates a secure connection or not. (true indicates a secure connection.) + + + An Action<TcpListenerWebSocketContext> delegate that contains the method(s) that is called when an asynchronous operation completes. + + + Accepts a WebSocket connection asynchronously by the . + + To be added. + + is . diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp/WebSocket.xml b/websocket-sharp/doc/mdoc/WebSocketSharp/WebSocket.xml index 46e392cf..cad4d74b 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp/WebSocket.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp/WebSocket.xml @@ -150,7 +150,7 @@ - A that contains a status code indicating a reason for closure. + A that contains a status code indicating a reason for closure. Closes the connection and releases all associated resources after sends a Close control frame. @@ -195,7 +195,7 @@ - A that contains a status code indicating a reason for closure. + A that contains a status code indicating a reason for closure. A that contains a reason for closure. @@ -435,7 +435,7 @@ - An array of that contains the binary data to be sent. + An array of that contains a binary data to send. Sends a binary data using the connection. @@ -455,7 +455,7 @@ - A that contains the binary data to be sent. + A that contains a binary data to send. Sends a binary data using the connection. @@ -475,7 +475,7 @@ - A that contains the text data to be sent. + A that contains a text data to send. Sends a text data using the connection. @@ -496,7 +496,7 @@ - An array of that contains the binary data to be sent. + An array of that contains a binary data to send. An delegate that contains the method(s) that is called when an asynchronous operation completes. @@ -520,7 +520,7 @@ - A that contains the binary data to be sent. + A that contains a binary data to send. An delegate that contains the method(s) that is called when an asynchronous operation completes. @@ -544,7 +544,7 @@ - A that contains the text data to be sent. + A that contains a text data to send. An delegate that contains the method(s) that is called when an asynchronous operation completes. diff --git a/websocket-sharp/doc/mdoc/index.xml b/websocket-sharp/doc/mdoc/index.xml index bc766ada..d1c32f40 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 ] @@ -82,31 +82,64 @@ - + - - + + ExtensionMethod WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext - + - - A that contains a TCP connection to accept a WebSocket connection from. + + A that provides a TCP connection to accept a WebSocket connection. A that indicates a secure connection or not. (true indicates a secure connection.) - Accept a WebSocket connection by the . + Accepts a WebSocket connection by the . - + + + + + + + + + + + ExtensionMethod + + System.Void + + + + + + + + + A that provides a TCP connection to accept a WebSocket connection. + + + A that indicates a secure connection or not. (true indicates a secure connection.) + + + An Action<TcpListenerWebSocketContext> delegate that contains the method(s) that is called when an asynchronous operation completes. + + + Accepts a WebSocket connection asynchronously by the . + + + diff --git a/websocket-sharp/websocket-sharp.pidb b/websocket-sharp/websocket-sharp.pidb index f67978c9..fdc8f550 100644 Binary files a/websocket-sharp/websocket-sharp.pidb and b/websocket-sharp/websocket-sharp.pidb differ