diff --git a/Example/bin/Debug_Ubuntu/example.exe b/Example/bin/Debug_Ubuntu/example.exe index 44d145be..9076cc12 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 0cd91be0..d9c4269f 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 44c92fba..88aef5a6 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 5bcb9896..a12b5378 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/Example1/bin/Debug_Ubuntu/example1.exe b/Example1/bin/Debug_Ubuntu/example1.exe index 31a1cc9c..64c8dac4 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 9f1f4939..b878be28 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 44c92fba..88aef5a6 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 5bcb9896..a12b5378 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/Example2/bin/Debug_Ubuntu/example2.exe b/Example2/bin/Debug_Ubuntu/example2.exe index c8d13080..57a34899 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 6ddccbd9..5009284a 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 44c92fba..88aef5a6 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 5bcb9896..a12b5378 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/Example3/bin/Debug_Ubuntu/Example3.exe b/Example3/bin/Debug_Ubuntu/Example3.exe index 173f8c95..5a50c19e 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 f1f6308d..7e318a3d 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 44c92fba..88aef5a6 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 5bcb9896..a12b5378 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/websocket-sharp/AssemblyInfo.cs b/websocket-sharp/AssemblyInfo.cs index dcdc29d1..4db7a594 100644 --- a/websocket-sharp/AssemblyInfo.cs +++ b/websocket-sharp/AssemblyInfo.cs @@ -5,7 +5,7 @@ using System.Runtime.CompilerServices; // Change them to the values specific to your project. [assembly: AssemblyTitle("websocket-sharp")] -[assembly: AssemblyDescription("A C# implementation of WebSocket protocol client & server")] +[assembly: AssemblyDescription("A C# implementation of the WebSocket protocol client & server")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("websocket-sharp.dll")] @@ -24,4 +24,3 @@ using System.Runtime.CompilerServices; //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")] - diff --git a/websocket-sharp/Server/IServiceHost.cs b/websocket-sharp/Server/IServiceHost.cs index 4ecfe8c1..a30f5a67 100644 --- a/websocket-sharp/Server/IServiceHost.cs +++ b/websocket-sharp/Server/IServiceHost.cs @@ -38,23 +38,23 @@ namespace WebSocketSharp.Server { public interface IServiceHost { /// - /// Gets or sets a value indicating whether the WebSocket service host cleans up the inactive service client. + /// Gets or sets a value indicating whether the WebSocket service host cleans up the inactive service clients periodically. /// /// - /// true if the WebSocket service host cleans up the inactive service client; otherwise, false. + /// true if the WebSocket service host cleans up the inactive service clients periodically; otherwise, false. /// bool Sweeped { get; set; } /// - /// Binds the specified instance to the WebSocket service. + /// Binds the specified to the WebSocket service instance. /// /// - /// An to bind. + /// A to bind. /// void BindWebSocket(WebSocket socket); /// - /// Broadcasts the specified . + /// Broadcasts the specified to all service clients. /// /// /// A to broadcast. diff --git a/websocket-sharp/Server/SessionManager.cs b/websocket-sharp/Server/SessionManager.cs deleted file mode 100644 index 50f71362..00000000 --- a/websocket-sharp/Server/SessionManager.cs +++ /dev/null @@ -1,312 +0,0 @@ -#region MIT License -/* - * SessionManager.cs - * - * The MIT License - * - * Copyright (c) 2012-2013 sta.blockhead - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#endregion - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Timers; - -namespace WebSocketSharp.Server { - - public class SessionManager { - - #region Private Fields - - private object _forSweep; - private volatile bool _isStopped; - private volatile bool _isSweeping; - private Dictionary _sessions; - private Timer _sweepTimer; - private object _syncRoot; - - #endregion - - #region Public Constructor - - public SessionManager() - { - _forSweep = new object(); - _isStopped = false; - _isSweeping = false; - _sessions = new Dictionary(); - _sweepTimer = new Timer(60 * 1000); - _sweepTimer.Elapsed += (sender, e) => - { - Sweep(); - }; - _syncRoot = new object(); - - startSweepTimer(); - } - - #endregion - - #region Properties - - public IEnumerable ActiveID { - get { - return from result in Broadping(String.Empty) - where result.Value - select result.Key; - } - } - - public int Count { - get { - lock (_syncRoot) - { - return _sessions.Count; - } - } - } - - public IEnumerable InactiveID { - get { - return from result in Broadping(String.Empty) - where !result.Value - select result.Key; - } - } - - public IEnumerable ID { - get { - lock (_syncRoot) - { - return _sessions.Keys; - } - } - } - - public bool Sweeped { - get { - return _sweepTimer.Enabled; - } - - set { - if (value && !_isStopped) - startSweepTimer(); - - if (!value) - stopSweepTimer(); - } - } - - public object SyncRoot { - get { - return _syncRoot; - } - } - - #endregion - - #region Private Methods - - private void broadcast(byte[] data) - { - lock (_syncRoot) - { - foreach (var service in _sessions.Values) - service.Send(data); - } - } - - private void broadcast(string data) - { - lock (_syncRoot) - { - foreach (var service in _sessions.Values) - service.Send(data); - } - } - - private void broadcastAsync(byte[] data) - { - var sessions = copySessions(); - var services = sessions.Values.GetEnumerator(); - - Action completed = null; - completed = () => - { - if (services.MoveNext()) - services.Current.SendAsync(data, completed); - }; - - if (services.MoveNext()) - services.Current.SendAsync(data, completed); - } - - private void broadcastAsync(string data) - { - var sessions = copySessions(); - var services = sessions.Values.GetEnumerator(); - - Action completed = null; - completed = () => - { - if (services.MoveNext()) - services.Current.SendAsync(data, completed); - }; - - if (services.MoveNext()) - services.Current.SendAsync(data, completed); - } - - private Dictionary copySessions() - { - lock (_syncRoot) - { - return new Dictionary(_sessions); - } - } - - private string createID() - { - return Guid.NewGuid().ToString("N"); - } - - private void startSweepTimer() - { - if (!Sweeped) - _sweepTimer.Start(); - } - - private void stopSweepTimer() - { - if (Sweeped) - _sweepTimer.Stop(); - } - - #endregion - - #region Public Methods - - public string Add(WebSocketService service) - { - lock (_syncRoot) - { - if (_isStopped) - return null; - - var id = createID(); - _sessions.Add(id, service); - - return id; - } - } - - public void Broadcast(byte[] data) - { - if (_isStopped) - broadcast(data); - else - broadcastAsync(data); - } - - public void Broadcast(string data) - { - if (_isStopped) - broadcast(data); - else - broadcastAsync(data); - } - - public Dictionary Broadping(string message) - { - var result = new Dictionary(); - foreach (var session in copySessions()) - result.Add(session.Key, session.Value.Ping(message)); - - return result; - } - - public bool Remove(string id) - { - lock (_syncRoot) - { - return _sessions.Remove(id); - } - } - - public bool TryGetByID(string id, out WebSocketService service) - { - lock (_syncRoot) - { - return _sessions.TryGetValue(id, out service); - } - } - - public void Stop() - { - Stop(CloseStatusCode.NORMAL, String.Empty); - } - - public void Stop(CloseStatusCode code, string reason) - { - stopSweepTimer(); - lock (_syncRoot) - { - if (_isStopped) - return; - - _isStopped = true; - foreach (var service in copySessions().Values) - service.Stop(code, reason); - } - } - - public void Sweep() - { - if (_isStopped || _isSweeping || Count == 0) - return; - - lock (_forSweep) - { - _isSweeping = true; - foreach (var id in InactiveID) - { - lock (_syncRoot) - { - if (_isStopped) - { - _isSweeping = false; - return; - } - - WebSocketService service; - if (TryGetByID(id, out service)) - service.Stop(CloseStatusCode.ABNORMAL, String.Empty); - } - } - - _isSweeping = false; - } - } - - #endregion - } -} diff --git a/websocket-sharp/Server/WebSocketServer.cs b/websocket-sharp/Server/WebSocketServer.cs index a463a95a..407910f7 100644 --- a/websocket-sharp/Server/WebSocketServer.cs +++ b/websocket-sharp/Server/WebSocketServer.cs @@ -111,7 +111,7 @@ namespace WebSocketSharp.Server { /// on the specified and . /// /// - /// A that contains an IP address. + /// A that contains a local IP address. /// /// /// An that contains a port number. @@ -126,7 +126,7 @@ namespace WebSocketSharp.Server { /// on the specified , and . /// /// - /// A that contains an IP address. + /// A that contains a local IP address. /// /// /// An that contains a port number. @@ -145,10 +145,10 @@ namespace WebSocketSharp.Server { #region Properties /// - /// Gets the paths associated with the each WebSocket services. + /// Gets the collection of paths associated with the every WebSocket services that the server provides. /// /// - /// An IEnumerable<string> that contains the paths. + /// An IEnumerable<string> that contains the collection of paths. /// public IEnumerable ServicePaths { get { @@ -161,10 +161,10 @@ namespace WebSocketSharp.Server { } /// - /// Gets or sets a value indicating whether the server cleans up the inactive client. + /// Gets or sets a value indicating whether the server cleans up the inactive clients periodically. /// /// - /// true if the server cleans up the inactive client; otherwise, false. + /// true if the server cleans up the inactive clients every 60 seconds; otherwise, false. /// public bool Sweeped { get { @@ -193,7 +193,7 @@ namespace WebSocketSharp.Server { /// Accepts a WebSocket connection. /// /// - /// A that contains a WebSocket connection. + /// A that contains the WebSocket connection request objects. /// protected override void AcceptWebSocket(TcpListenerWebSocketContext context) { @@ -221,10 +221,10 @@ namespace WebSocketSharp.Server { /// Adds a WebSocket service. /// /// - /// A that contains an absolute path associated with a WebSocket service. + /// A that contains an absolute path associated with the WebSocket service. /// /// - /// The type of a WebSocket service. The T must inherit the class. + /// The type of the WebSocket service. The T must inherit the class. /// public void AddService(string absPath) where T : WebSocketService, new() diff --git a/websocket-sharp/Server/WebSocketServerBase.cs b/websocket-sharp/Server/WebSocketServerBase.cs index 1cd0c3c7..1f8febab 100644 --- a/websocket-sharp/Server/WebSocketServerBase.cs +++ b/websocket-sharp/Server/WebSocketServerBase.cs @@ -96,7 +96,7 @@ namespace WebSocketSharp.Server { /// on the specified , , and . /// /// - /// A that contains an IP address. + /// A that contains a local IP address. /// /// /// An that contains a port number. @@ -177,10 +177,10 @@ namespace WebSocketSharp.Server { #region Public Properties /// - /// Gets the IP address on which to listen for incoming connection attempts. + /// Gets the local IP address on which to listen for incoming connection attempts. /// /// - /// A that contains an IP address. + /// A that contains a local IP address. /// public IPAddress Address { get { @@ -189,10 +189,10 @@ namespace WebSocketSharp.Server { } /// - /// Gets a value indicating whether this server provides secure connection. + /// Gets a value indicating whether the server provides secure connection. /// /// - /// true if this server provides secure connection; otherwise, false. + /// true if the server provides secure connection; otherwise, false. /// public bool IsSecure { get { @@ -201,10 +201,10 @@ namespace WebSocketSharp.Server { } /// - /// Gets a value indicating whether this server is self host. + /// Gets a value indicating whether the server is self host. /// /// - /// true if this server is self host; otherwise, false. + /// true if the server is self host; otherwise, false. /// public bool IsSelfHost { get { @@ -339,7 +339,7 @@ namespace WebSocketSharp.Server { /// Accepts a WebSocket connection. /// /// - /// A that contains a WebSocket connection. + /// A that contains the WebSocket connection request objects. /// protected abstract void AcceptWebSocket(TcpListenerWebSocketContext context); diff --git a/websocket-sharp/Server/WebSocketService.cs b/websocket-sharp/Server/WebSocketService.cs index dead0831..d02a8e12 100644 --- a/websocket-sharp/Server/WebSocketService.cs +++ b/websocket-sharp/Server/WebSocketService.cs @@ -43,8 +43,8 @@ namespace WebSocketSharp.Server { #region Private Fields - private SessionManager _sessions; - private WebSocket _socket; + private WebSocketServiceManager _sessions; + private WebSocket _socket; #endregion @@ -79,9 +79,9 @@ namespace WebSocketSharp.Server { /// Gets the sessions to the WebSocket service. /// /// - /// A that contains the sessions to the WebSocket service. + /// A that contains the sessions to the WebSocket service. /// - protected SessionManager Sessions { + protected WebSocketServiceManager Sessions { get { return IsBound ? _sessions : null; } @@ -92,18 +92,18 @@ namespace WebSocketSharp.Server { #region Public Properties /// - /// Gets the ID of a instance. + /// Gets the ID of the instance. /// /// - /// A that contains a ID. + /// A that contains an ID. /// public string ID { get; private set; } /// - /// Gets a value indicating whether a instance is bound to a . + /// Gets a value indicating whether the instance is bound to a . /// /// - /// true if the WebSocketService is bound to a WebSocket; otherwise, false. + /// true if the instance is bound to a ; otherwise, false. /// public bool IsBound { get; private set; } @@ -137,6 +137,22 @@ namespace WebSocketSharp.Server { #region Internal Methods + internal void Bind(WebSocket socket, WebSocketServiceManager sessions) + { + if (IsBound) + return; + + _socket = socket; + _sessions = sessions; + + _socket.OnOpen += onOpen; + _socket.OnMessage += onMessage; + _socket.OnError += onError; + _socket.OnClose += onClose; + + IsBound = true; + } + internal void SendAsync(byte[] data, Action completed) { _socket.SendAsync(data, completed); @@ -152,7 +168,7 @@ namespace WebSocketSharp.Server { #region Protected Methods /// - /// Occurs when a inner receives a Close frame or the Stop method is called. + /// Occurs when the inner receives a Close frame or the Stop method is called. /// /// /// A that contains the event data associated with a event. @@ -162,7 +178,7 @@ namespace WebSocketSharp.Server { } /// - /// Occurs when a inner gets an error. + /// Occurs when the inner gets an error. /// /// /// An that contains the event data associated with a event. @@ -172,7 +188,7 @@ namespace WebSocketSharp.Server { } /// - /// Occurs when a inner receives a data frame. + /// Occurs when the inner receives a data frame. /// /// /// A that contains the event data associated with a event. @@ -193,33 +209,8 @@ namespace WebSocketSharp.Server { #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; - - _socket.OnOpen += onOpen; - _socket.OnMessage += onMessage; - _socket.OnError += onError; - _socket.OnClose += onClose; - - IsBound = true; - } - - /// - /// Broadcasts the specified array of to all clients of the WebSocket service. + /// Broadcasts the specified array of to the clients of every instances + /// in the . /// /// /// An array of to broadcast. @@ -231,7 +222,8 @@ namespace WebSocketSharp.Server { } /// - /// Broadcasts the specified to all clients of the WebSocket service. + /// Broadcasts the specified to the clients of every instances + /// in the . /// /// /// A to broadcast. @@ -243,11 +235,12 @@ namespace WebSocketSharp.Server { } /// - /// Pings to all clients of the WebSocket service. + /// Pings to the clients of every instances + /// in the . /// /// - /// 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 Dictionary<string, bool> that contains the collection of IDs and values + /// indicating whether each instances received a Pong in a time. /// public Dictionary Broadping() { @@ -255,11 +248,12 @@ namespace WebSocketSharp.Server { } /// - /// Pings with the specified to all clients of the WebSocket service. + /// Pings with the specified to the clients of every instances + /// in the . /// /// - /// 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 Dictionary<string, bool> that contains the collection of IDs and values + /// indicating whether each instances received a Pong in a time. /// /// /// A that contains a message. @@ -272,10 +266,10 @@ namespace WebSocketSharp.Server { } /// - /// Pings to the client of a instance. + /// Pings to the client of the instance. /// /// - /// true if the WebSocketService receives a Pong in a time; otherwise, false. + /// true if the instance receives a Pong in a time; otherwise, false. /// public bool Ping() { @@ -283,10 +277,10 @@ namespace WebSocketSharp.Server { } /// - /// Pings with the specified to the client of a instance. + /// Pings with the specified to the client of the instance. /// /// - /// true if the WebSocketService receives a Pong in a time; otherwise, false. + /// true if the instance receives a Pong in a time; otherwise, false. /// /// /// A that contains a message. @@ -299,13 +293,14 @@ namespace WebSocketSharp.Server { } /// - /// Pings to the client of a instance associated with the specified ID. + /// Pings to the client of the instance + /// associated with the specified . /// /// - /// true if the WebSocket service receives a Pong in a time; otherwise, false. + /// true if the instance receives a Pong in a time; otherwise, false. /// /// - /// A that contains a ID that represents the destination for the Ping. + /// A that contains an ID that represents the destination for the Ping. /// public bool PingTo(string id) { @@ -313,14 +308,14 @@ namespace WebSocketSharp.Server { } /// - /// Pings with the specified to the client of a instance - /// associated with the specified ID. + /// Pings with the specified to the client of the instance + /// associated with the specified . /// /// - /// true if the WebSocketService receives a Pong in a time; otherwise, false. + /// true if the instance receives a Pong in a time; otherwise, false. /// /// - /// A that contains a ID that represents the destination for the Ping. + /// A that contains an ID that represents the destination for the Ping. /// /// /// A that contains a message. @@ -331,13 +326,13 @@ namespace WebSocketSharp.Server { return false; WebSocketService service; - return _sessions.TryGetByID(id, out service) + return _sessions.TryGetWebSocketService(id, out service) ? service.Ping(message) : false; } /// - /// Sends a binary data to the client of a instance. + /// Sends a binary data to the client of the instance. /// /// /// An array of that contains a binary data to send. @@ -349,7 +344,7 @@ namespace WebSocketSharp.Server { } /// - /// Sends a text data to the client of a instance. + /// Sends a text data to the client of the instance. /// /// /// A that contains a text data to send. @@ -361,10 +356,11 @@ namespace WebSocketSharp.Server { } /// - /// Sends a binary data to the client of a instance associated with the specified ID. + /// Sends a binary data to the client of the instance + /// associated with the specified . /// /// - /// A that contains a ID that represents the destination for the data. + /// A that contains an ID that represents the destination for the data. /// /// /// An array of that contains a binary data to send. @@ -375,15 +371,16 @@ namespace WebSocketSharp.Server { return; WebSocketService service; - if (_sessions.TryGetByID(id, out service)) + if (_sessions.TryGetWebSocketService(id, out service)) service.Send(data); } /// - /// Sends a text data to the client of a instance associated with the specified ID. + /// Sends a text data to the client of the instance + /// associated with the specified . /// /// - /// A that contains a ID that represents the destination for the data. + /// A that contains an ID that represents the destination for the data. /// /// /// A that contains a text data to send. @@ -394,12 +391,12 @@ namespace WebSocketSharp.Server { return; WebSocketService service; - if (_sessions.TryGetByID(id, out service)) + if (_sessions.TryGetWebSocketService(id, out service)) service.Send(data); } /// - /// Starts a instance. + /// Starts the instance. /// public void Start() { @@ -408,7 +405,7 @@ namespace WebSocketSharp.Server { } /// - /// Stops a instance. + /// Stops the instance. /// public void Stop() { @@ -419,34 +416,34 @@ namespace WebSocketSharp.Server { } /// - /// Stops a instance with the specified and . + /// Stops the instance with the specified and . /// /// - /// One of the values that contains a status code indicating the reason for stop. + /// A that contains a status code indicating the reason for stop. /// /// /// A that contains a reason for stop. /// - public void Stop(CloseStatusCode code, string reason) + public void Stop(ushort code, string reason) { - Stop((ushort)code, reason); + if (!IsBound) + return; + + _socket.Close(code, reason); } /// - /// Stops a instance with the specified and . + /// Stops the instance with the specified and . /// /// - /// A that contains a status code indicating the reason for stop. + /// One of the values that contains a status code indicating the reason for stop. /// /// /// A that contains a reason for stop. /// - public void Stop(ushort code, string reason) + public void Stop(CloseStatusCode code, string reason) { - if (!IsBound) - return; - - _socket.Close(code, reason); + Stop((ushort)code, reason); } #endregion diff --git a/websocket-sharp/Server/WebSocketServiceHost.cs b/websocket-sharp/Server/WebSocketServiceHost.cs index d2278a1f..f5837367 100644 --- a/websocket-sharp/Server/WebSocketServiceHost.cs +++ b/websocket-sharp/Server/WebSocketServiceHost.cs @@ -50,7 +50,7 @@ namespace WebSocketSharp.Server { { #region Field - private SessionManager _sessions; + private WebSocketServiceManager _sessions; #endregion @@ -143,7 +143,7 @@ namespace WebSocketSharp.Server { /// on the specified , and . /// /// - /// A that contains an IP address. + /// A that contains a local IP address. /// /// /// An that contains a port number. @@ -161,7 +161,7 @@ namespace WebSocketSharp.Server { /// on the specified , , and . /// /// - /// A that contains an IP address. + /// A that contains a local IP address. /// /// /// An that contains a port number. @@ -183,10 +183,10 @@ namespace WebSocketSharp.Server { #region Properties /// - /// Gets or sets a value indicating whether the server cleans up the inactive client. + /// Gets or sets a value indicating whether the server cleans up the inactive clients periodically. /// /// - /// true if the server cleans up the inactive client; otherwise, false. + /// true if the server cleans up the inactive clients every 60 seconds; otherwise, false. /// public bool Sweeped { get { @@ -220,7 +220,7 @@ namespace WebSocketSharp.Server { private void init() { - _sessions = new SessionManager(); + _sessions = new WebSocketServiceManager(); } #endregion @@ -228,7 +228,7 @@ namespace WebSocketSharp.Server { #region Explicit Interface Implementation /// - /// Binds the specified instance to the WebSocket service. + /// Binds the specified to the WebSocket service instance. /// /// /// A to bind. @@ -248,7 +248,7 @@ namespace WebSocketSharp.Server { /// Accepts a WebSocket connection. /// /// - /// A that contains a WebSocket connection. + /// A that contains the WebSocket connection request objects. /// protected override void AcceptWebSocket(TcpListenerWebSocketContext context) { @@ -285,8 +285,8 @@ 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 Dictionary<string, bool> that contains the collection of session IDs and values + /// indicating whether the server received the Pongs from each clients in a time. /// /// /// A that contains a message. diff --git a/websocket-sharp/Server/WebSocketServiceManager.cs b/websocket-sharp/Server/WebSocketServiceManager.cs new file mode 100644 index 00000000..9ce56f6d --- /dev/null +++ b/websocket-sharp/Server/WebSocketServiceManager.cs @@ -0,0 +1,408 @@ +#region MIT License +/* + * WebSocketServiceManager.cs + * + * The MIT License + * + * Copyright (c) 2012-2013 sta.blockhead + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#endregion + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Timers; + +namespace WebSocketSharp.Server { + + /// + /// Manages the collection of objects. + /// + public class WebSocketServiceManager { + + #region Fields + + private object _forSweep; + private volatile bool _isStopped; + private volatile bool _isSweeping; + private Dictionary _services; + private Timer _sweepTimer; + private object _syncRoot; + + #endregion + + #region Constructor + + internal WebSocketServiceManager() + { + _forSweep = new object(); + _isStopped = false; + _isSweeping = false; + _services = new Dictionary(); + _syncRoot = new object(); + + setSweepTimer(); + startSweepTimer(); + } + + #endregion + + #region Properties + + /// + /// Gets the collection of IDs of active objects + /// managed by the . + /// + /// + /// An IEnumerable<string> that contains the collection of IDs of active objects. + /// + public IEnumerable ActiveIDs { + get { + return from result in Broadping(String.Empty) + where result.Value + select result.Key; + } + } + + /// + /// Gets the number of objects + /// managed by the . + /// + /// + /// An that contains the number of objects + /// managed by the . + /// + public int Count { + get { + lock (_syncRoot) + { + return _services.Count; + } + } + } + + /// + /// Gets the collection of IDs of inactive objects + /// managed by the . + /// + /// + /// An IEnumerable<string> that contains the collection of IDs of inactive objects. + /// + public IEnumerable InactiveIDs { + get { + return from result in Broadping(String.Empty) + where !result.Value + select result.Key; + } + } + + /// + /// Gets the collection of IDs of objects + /// managed by the . + /// + /// + /// An IEnumerable<string> that contains the collection of IDs of objects. + /// + public IEnumerable IDs { + get { + lock (_syncRoot) + { + return _services.Keys; + } + } + } + + /// + /// Gets a value indicating whether the cleans up + /// the inactive objects periodically. + /// + /// + /// true if the cleans up the inactive objects + /// every 60 seconds; otherwise, false. + /// + public bool Sweeped { + get { + return _sweepTimer.Enabled; + } + + internal set { + if (value && !_isStopped) + startSweepTimer(); + + if (!value) + stopSweepTimer(); + } + } + + #endregion + + #region Private Methods + + private void broadcast(byte[] data) + { + lock (_syncRoot) + { + foreach (var service in _services.Values) + service.Send(data); + } + } + + private void broadcast(string data) + { + lock (_syncRoot) + { + foreach (var service in _services.Values) + service.Send(data); + } + } + + private void broadcastAsync(byte[] data) + { + var copied = copy(); + var services = copied.Values.GetEnumerator(); + + Action completed = null; + completed = () => + { + if (services.MoveNext()) + services.Current.SendAsync(data, completed); + }; + + if (services.MoveNext()) + services.Current.SendAsync(data, completed); + } + + private void broadcastAsync(string data) + { + var copied = copy(); + var services = copied.Values.GetEnumerator(); + + Action completed = null; + completed = () => + { + if (services.MoveNext()) + services.Current.SendAsync(data, completed); + }; + + if (services.MoveNext()) + services.Current.SendAsync(data, completed); + } + + private Dictionary copy() + { + lock (_syncRoot) + { + return new Dictionary(_services); + } + } + + private string createID() + { + return Guid.NewGuid().ToString("N"); + } + + private void setSweepTimer() + { + _sweepTimer = new Timer(60 * 1000); + _sweepTimer.Elapsed += (sender, e) => + { + Sweep(); + }; + } + + private void startSweepTimer() + { + if (!Sweeped) + _sweepTimer.Start(); + } + + private void stop(ushort code, string reason, bool ignoreArgs) + { + stopSweepTimer(); + lock (_syncRoot) + { + if (_isStopped) + return; + + _isStopped = true; + foreach (var service in copy().Values) + if (ignoreArgs) + service.Stop(); + else + service.Stop(code, reason); + } + } + + private void stopSweepTimer() + { + if (Sweeped) + _sweepTimer.Stop(); + } + + #endregion + + #region Internal Methods + + internal string Add(WebSocketService service) + { + lock (_syncRoot) + { + if (_isStopped) + return null; + + var id = createID(); + _services.Add(id, service); + + return id; + } + } + + internal bool Remove(string id) + { + lock (_syncRoot) + { + return _services.Remove(id); + } + } + + internal void Stop() + { + stop(0, null, true); + } + + internal void Stop(ushort code, string reason) + { + stop(code, reason, false); + } + + internal void Stop(CloseStatusCode code, string reason) + { + Stop((ushort)code, reason); + } + + #endregion + + #region Public Methods + + /// + /// Broadcasts the specified array of to the clients of every + /// managed by the . + /// + /// + /// An array of to broadcast. + /// + public void Broadcast(byte[] data) + { + if (_isStopped) + broadcast(data); + else + broadcastAsync(data); + } + + /// + /// Broadcasts the specified to the clients of every + /// managed by the . + /// + /// + /// A to broadcast. + /// + public void Broadcast(string data) + { + if (_isStopped) + broadcast(data); + else + broadcastAsync(data); + } + + /// + /// Pings with the specified to the clients of every + /// managed by the . + /// + /// + /// A Dictionary<string, bool> that contains the collection of IDs and values + /// indicating whether each received a Pong in a time. + /// + /// + /// A that contains a message. + /// + public Dictionary Broadping(string message) + { + var result = new Dictionary(); + foreach (var session in copy()) + result.Add(session.Key, session.Value.Ping(message)); + + return result; + } + + /// + /// Cleans up the inactive objects. + /// + public void Sweep() + { + if (_isStopped || _isSweeping || Count == 0) + return; + + lock (_forSweep) + { + _isSweeping = true; + foreach (var id in InactiveIDs) + { + lock (_syncRoot) + { + if (_isStopped) + { + _isSweeping = false; + return; + } + + WebSocketService service; + if (TryGetWebSocketService(id, out service)) + service.Stop(CloseStatusCode.ABNORMAL, String.Empty); + } + } + + _isSweeping = false; + } + } + + /// + /// Tries to get the associated with the specified . + /// + /// + /// true if the manages the with the specified ; otherwise, false. + /// + /// + /// A that contains the ID to find. + /// + /// + /// When this method returns, contains the with the specified , if the is found; otherwise, . + /// + public bool TryGetWebSocketService(string id, out WebSocketService service) + { + lock (_syncRoot) + { + return _services.TryGetValue(id, out service); + } + } + + #endregion + } +} diff --git a/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll b/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll index 44c92fba..88aef5a6 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 5bcb9896..a12b5378 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_Ubuntu/websocket-sharp.dll b/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.dll index ea398411..de5c600d 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 0ca5374a..23d49497 100644 --- a/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.xml +++ b/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.xml @@ -1061,7 +1061,7 @@ on the specified and . - A that contains an IP address. + A that contains a local IP address. An that contains a port number. @@ -1073,7 +1073,7 @@ on the specified , and . - A that contains an IP address. + A that contains a local IP address. An that contains a port number. @@ -1084,18 +1084,18 @@ - Gets the paths associated with the each WebSocket services. + Gets the collection of paths associated with the every WebSocket services that the server provides. - An IEnumerable<string> that contains the paths. + An IEnumerable<string> that contains the collection of paths. - Gets or sets a value indicating whether the server cleans up the inactive client. + Gets or sets a value indicating whether the server cleans up the inactive clients periodically. - true if the server cleans up the inactive client; otherwise, false. + true if the server cleans up the inactive clients every 60 seconds; otherwise, false. @@ -1103,7 +1103,7 @@ Accepts a WebSocket connection. - A that contains a WebSocket connection. + A that contains the WebSocket connection request objects. @@ -1111,10 +1111,10 @@ Adds a WebSocket service. - A that contains an absolute path associated with a WebSocket service. + A that contains an absolute path associated with the WebSocket service. - The type of a WebSocket service. The T must inherit the class. + The type of the WebSocket service. The T must inherit the class. @@ -1156,28 +1156,28 @@ Gets the sessions to the WebSocket service. - A that contains the sessions to the WebSocket service. + A that contains the sessions to the WebSocket service. - Gets the ID of a instance. + Gets the ID of the instance. - A that contains a ID. + A that contains an ID. - Gets a value indicating whether a instance is bound to a . + Gets a value indicating whether the instance is bound to a . - true if the WebSocketService is bound to a WebSocket; otherwise, false. + true if the instance is bound to a ; otherwise, false. - Occurs when a inner receives a Close frame or the Stop method is called. + Occurs when the inner receives a Close frame or the Stop method is called. A that contains the event data associated with a event. @@ -1185,7 +1185,7 @@ - Occurs when a inner gets an error. + Occurs when the inner gets an error. An that contains the event data associated with a event. @@ -1193,7 +1193,7 @@ - Occurs when a inner receives a data frame. + Occurs when the inner receives a data frame. A that contains the event data associated with a event. @@ -1204,21 +1204,10 @@ 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. + Broadcasts the specified array of to the clients of every instances + in the . An array of to broadcast. @@ -1226,7 +1215,8 @@ - Broadcasts the specified to all clients of the WebSocket service. + Broadcasts the specified to the clients of every instances + in the . A to broadcast. @@ -1234,20 +1224,22 @@ - Pings to all clients of the WebSocket service. + Pings to the clients of every instances + in the . - 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 Dictionary<string, bool> that contains the collection of IDs and values + indicating whether each instances received a Pong in a time. - Pings with the specified to all clients of the WebSocket service. + Pings with the specified to the clients of every instances + in the . - 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 Dictionary<string, bool> that contains the collection of IDs and values + indicating whether each instances received a Pong in a time. A that contains a message. @@ -1255,18 +1247,18 @@ - Pings to the client of a instance. + Pings to the client of the instance. - true if the WebSocketService receives a Pong in a time; otherwise, false. + true if the instance receives a Pong in a time; otherwise, false. - Pings with the specified to the client of a instance. + Pings with the specified to the client of the instance. - true if the WebSocketService receives a Pong in a time; otherwise, false. + true if the instance receives a Pong in a time; otherwise, false. A that contains a message. @@ -1274,25 +1266,26 @@ - Pings to the client of a instance associated with the specified ID. + Pings to the client of the instance + associated with the specified . - true if the WebSocket service receives a Pong in a time; otherwise, false. + true if the instance receives a Pong in a time; otherwise, false. - A that contains a ID that represents the destination for the Ping. + A that contains an ID that represents the destination for the Ping. - Pings with the specified to the client of a instance - associated with the specified ID. + Pings with the specified to the client of the instance + associated with the specified . - true if the WebSocketService receives a Pong in a time; otherwise, false. + true if the instance receives a Pong in a time; otherwise, false. - A that contains a ID that represents the destination for the Ping. + A that contains an ID that represents the destination for the Ping. A that contains a message. @@ -1300,7 +1293,7 @@ - Sends a binary data to the client of a instance. + Sends a binary data to the client of the instance. An array of that contains a binary data to send. @@ -1308,7 +1301,7 @@ - Sends a text data to the client of a instance. + Sends a text data to the client of the instance. A that contains a text data to send. @@ -1316,10 +1309,11 @@ - Sends a binary data to the client of a instance associated with the specified ID. + Sends a binary data to the client of the instance + associated with the specified . - A that contains a ID that represents the destination for the data. + A that contains an ID that represents the destination for the data. An array of that contains a binary data to send. @@ -1327,10 +1321,11 @@ - Sends a text data to the client of a instance associated with the specified ID. + Sends a text data to the client of the instance + associated with the specified . - A that contains a ID that represents the destination for the data. + A that contains an ID that represents the destination for the data. A that contains a text data to send. @@ -1338,31 +1333,31 @@ - Starts a instance. + Starts the instance. - Stops a instance. + Stops the instance. - + - Stops a instance with the specified and . + Stops the instance with the specified and . - One of the values that contains a status code indicating the reason for stop. + 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 . + Stops the instance with the specified and . - A that contains a status code indicating the reason for stop. + One of the values that contains a status code indicating the reason for stop. A that contains a reason for stop. @@ -1430,7 +1425,7 @@ on the specified , , and . - A that contains an IP address. + A that contains a local IP address. An that contains a port number. @@ -1471,26 +1466,26 @@ - Gets the IP address on which to listen for incoming connection attempts. + Gets the local IP address on which to listen for incoming connection attempts. - A that contains an IP address. + A that contains a local IP address. - Gets a value indicating whether this server provides secure connection. + Gets a value indicating whether the server provides secure connection. - true if this server provides secure connection; otherwise, false. + true if the server provides secure connection; otherwise, false. - Gets a value indicating whether this server is self host. + Gets a value indicating whether the server is self host. - true if this server is self host; otherwise, false. + true if the server is self host; otherwise, false. @@ -1506,7 +1501,7 @@ Accepts a WebSocket connection. - A that contains a WebSocket connection. + A that contains the WebSocket connection request objects. @@ -1536,23 +1531,23 @@ - Gets or sets a value indicating whether the WebSocket service host cleans up the inactive service client. + Gets or sets a value indicating whether the WebSocket service host cleans up the inactive service clients periodically. - true if the WebSocket service host cleans up the inactive service client; otherwise, false. + true if the WebSocket service host cleans up the inactive service clients periodically; otherwise, false. - Binds the specified instance to the WebSocket service. + Binds the specified to the WebSocket service instance. - An to bind. + A to bind. - Broadcasts the specified . + Broadcasts the specified to all service clients. A to broadcast. @@ -1642,7 +1637,7 @@ on the specified , and . - A that contains an IP address. + A that contains a local IP address. An that contains a port number. @@ -1657,7 +1652,7 @@ on the specified , , and . - A that contains an IP address. + A that contains a local IP address. An that contains a port number. @@ -1671,10 +1666,10 @@ - Gets or sets a value indicating whether the server cleans up the inactive client. + Gets or sets a value indicating whether the server cleans up the inactive clients periodically. - true if the server cleans up the inactive client; otherwise, false. + true if the server cleans up the inactive clients every 60 seconds; otherwise, false. @@ -1687,7 +1682,7 @@ - Binds the specified instance to the WebSocket service. + Binds the specified to the WebSocket service instance. A to bind. @@ -1698,7 +1693,7 @@ Accepts a WebSocket connection. - A that contains a WebSocket connection. + A that contains the WebSocket connection request objects. @@ -1714,8 +1709,8 @@ 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 Dictionary<string, bool> that contains the collection of session IDs and values + indicating whether the server received the Pongs from each clients in a time. A that contains a message. @@ -2257,5 +2252,107 @@ A . + + + Manages the collection of objects. + + + + + Gets the collection of IDs of active objects + managed by the . + + + An IEnumerable<string> that contains the collection of IDs of active objects. + + + + + Gets the number of objects + managed by the . + + + An that contains the number of objects + managed by the . + + + + + Gets the collection of IDs of inactive objects + managed by the . + + + An IEnumerable<string> that contains the collection of IDs of inactive objects. + + + + + Gets the collection of IDs of objects + managed by the . + + + An IEnumerable<string> that contains the collection of IDs of objects. + + + + + Gets a value indicating whether the cleans up + the inactive objects periodically. + + + true if the cleans up the inactive objects + every 60 seconds; otherwise, false. + + + + + Broadcasts the specified array of to the clients of every + managed by the . + + + An array of to broadcast. + + + + + Broadcasts the specified to the clients of every + managed by the . + + + A to broadcast. + + + + + Pings with the specified to the clients of every + managed by the . + + + A Dictionary<string, bool> that contains the collection of IDs and values + indicating whether each received a Pong in a time. + + + A that contains a message. + + + + + Cleans up the inactive objects. + + + + + Tries to get the associated with the specified . + + + true if the manages the with the specified ; otherwise, false. + + + A that contains the ID to find. + + + When this method returns, contains the with the specified , if the is found; otherwise, . + + diff --git a/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/index.html b/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/index.html index 4b4e132c..e526b6ba 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/index.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Net.WebSockets/index.html @@ -196,7 +196,7 @@

Namespace

-

The WebSocketSharp.Net.WebSockets namespace provides access to the WebSocket connection request objects sent from the client to the server.

+

The WebSocketSharp.Net.WebSockets namespace contains classes to access to the WebSocket connection request objects.

diff --git a/websocket-sharp/doc/html/WebSocketSharp.Net/index.html b/websocket-sharp/doc/html/WebSocketSharp.Net/index.html index 7c0164d4..a8de8d25 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Net/index.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Net/index.html @@ -196,7 +196,7 @@

Namespace

-

The WebSocketSharp.Net namespace provides some modified classes in the System.Net namespace (e.g. System.Net.HttpListenerContext) to accept the WebSocket connection request.

+

The WebSocketSharp.Net namespace contains some modified classes and enumerations in the System.Net namespace (e.g. System.Net.HttpListenerContext) to accept the WebSocket connection requests.

Type
diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/IServiceHost.html b/websocket-sharp/doc/html/WebSocketSharp.Server/IServiceHost.html index 753666e1..59bdc8fe 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/IServiceHost.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/IServiceHost.html @@ -240,7 +240,7 @@ bool . - Gets or sets a value indicating whether the WebSocket service host cleans up the inactive service client. + Gets or sets a value indicating whether the WebSocket service host cleans up the inactive service clients periodically.
Type
@@ -259,7 +259,7 @@ BindWebSocket (WebSocketSharp.WebSocket)
- Binds the specified WebSocketSharp.WebSocket instance to the WebSocket service. + Binds the specified WebSocketSharp.WebSocket to the WebSocket service instance.
@@ -271,7 +271,7 @@ Broadcast (string)
- Broadcasts the specified string. + Broadcasts the specified string to all service clients.
@@ -339,7 +339,7 @@

BindWebSocket Method

- Binds the specified WebSocketSharp.WebSocket instance to the WebSocket service. + Binds the specified WebSocketSharp.WebSocket to the WebSocket service instance.

Syntax

public void BindWebSocket (WebSocketSharp.WebSocket socket)
@@ -350,7 +350,7 @@ socket
- An WebSocketSharp.WebSocket to bind. + A WebSocketSharp.WebSocket to bind.
@@ -366,7 +366,7 @@

Broadcast Method

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

Syntax

public void Broadcast (string data)
@@ -425,13 +425,13 @@

Sweeped Property

- Gets or sets a value indicating whether the WebSocket service host cleans up the inactive service client. + Gets or sets a value indicating whether the WebSocket service host cleans up the inactive service clients periodically.

Syntax

public bool Sweeped { get; set; }

Value

- true if the WebSocket service host cleans up the inactive service client; otherwise, false. + true if the WebSocket service host cleans up the inactive service clients periodically; otherwise, false.

Remarks

diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServer.html b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServer.html index 1db08742..32e2604e 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServer.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServer.html @@ -344,7 +344,7 @@ System.Net.IPAddress . - Gets the IP address on which to listen for incoming connection attempts. + Gets the local 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 provides secure connection. + Gets a value indicating whether the server provides secure connection. (Inherited from WebSocketServerBase.) @@ -372,7 +372,7 @@ bool . - Gets a value indicating whether this server is self host. + Gets a value indicating whether the server is self host. (Inherited from WebSocketServerBase.) @@ -400,7 +400,7 @@ IEnumerable<string> . - Gets the paths associated with the each WebSocket services. + Gets the collection of paths associated with the every WebSocket services that the server provides. @@ -417,7 +417,7 @@ bool . - Gets or sets a value indicating whether the server cleans up the inactive client. + Gets or sets a value indicating whether the server cleans up the inactive clients periodically. @@ -731,7 +731,7 @@ address
- A System.Net.IPAddress that contains an IP address. + A System.Net.IPAddress that contains a local IP address.
port @@ -765,7 +765,7 @@ address
- A System.Net.IPAddress that contains an IP address. + A System.Net.IPAddress that contains a local IP address.
port @@ -804,7 +804,7 @@ context
- A WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext that contains a WebSocket connection. + A WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext that contains the WebSocket connection request objects.
@@ -831,7 +831,7 @@ T
- The type of a WebSocket service. The T must inherit the WebSocketSharp.Server.WebSocketService class. + The type of the 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 a WebSocket service. + A string that contains an absolute path associated with the WebSocket service.
@@ -885,13 +885,13 @@

ServicePaths Property

- Gets the paths associated with the each WebSocket services. + Gets the collection of paths associated with the every WebSocket services that the server provides.

Syntax

public IEnumerable<string> ServicePaths { get; }

Value

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

Remarks

@@ -921,13 +921,13 @@

Sweeped Property

- Gets or sets a value indicating whether the server cleans up the inactive client. + Gets or sets a value indicating whether the server cleans up the inactive clients periodically.

Syntax

public bool Sweeped { get; set; }

Value

- true if the server cleans up the inactive client; otherwise, false. + true if the server cleans up the inactive clients every 60 seconds; otherwise, false.

Remarks

diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServerBase.html b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServerBase.html index 58472219..44b518e2 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 IP address on which to listen for incoming connection attempts. + Gets the local IP address on which to listen for incoming connection attempts. @@ -310,7 +310,7 @@ bool . - Gets a value indicating whether this server provides secure connection. + Gets a value indicating whether the server provides secure connection. @@ -324,7 +324,7 @@ bool . - Gets a value indicating whether this server is self host. + Gets a value indicating whether the server is self host. @@ -569,7 +569,7 @@ address
- A System.Net.IPAddress that contains an IP address. + A System.Net.IPAddress that contains a local IP address.
port @@ -647,7 +647,7 @@ context
- A WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext that contains a WebSocket connection. + A WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext that contains the WebSocket connection request objects.
@@ -663,13 +663,13 @@

Address Property

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

Syntax

public System.Net.IPAddress Address { get; }

Value

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

Remarks

@@ -730,13 +730,13 @@

IsSecure Property

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

Syntax

public bool IsSecure { get; }

Value

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

Remarks

@@ -750,13 +750,13 @@

IsSelfHost Property

- Gets a value indicating whether this server is self host. + Gets a value indicating whether the server is self host.

Syntax

public bool IsSelfHost { get; }

Value

- true if this server is self host; otherwise, false. + true if the server is self host; otherwise, false.

Remarks

diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketService.html b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketService.html index 9d583ec0..aac17ad9 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketService.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketService.html @@ -264,7 +264,7 @@ string . - Gets the ID of a WebSocketSharp.Server.WebSocketService instance. + Gets the ID of the WebSocketSharp.Server.WebSocketService instance. @@ -278,7 +278,7 @@ bool . - Gets a value indicating whether a WebSocketSharp.Server.WebSocketService instance is bound to a WebSocketSharp.WebSocket. + Gets a value indicating whether the WebSocketSharp.Server.WebSocketService instance is bound to a WebSocketSharp.WebSocket. @@ -311,7 +311,7 @@ - SessionManager + WebSocketServiceManager . Gets the sessions to the WebSocket service. @@ -323,19 +323,6 @@
- - - - @@ -357,7 +345,8 @@ Broadcast (string)
- Broadcasts the specified string to all clients of the WebSocket service. + Broadcasts the specified string to the clients of every WebSocketSharp.Server.WebSocketService instances + in the WebSocketService.Sessions.
@@ -369,7 +358,8 @@ Broadping () : Dictionary<string, bool>
- Pings to all clients of the WebSocket service. + Pings to the clients of every WebSocketSharp.Server.WebSocketService instances + in the WebSocketService.Sessions.
@@ -381,7 +371,8 @@ Broadping (string) : Dictionary<string, bool>
- Pings with the specified string to all clients of the WebSocket service. + Pings with the specified string to the clients of every WebSocketSharp.Server.WebSocketService instances + in the WebSocketService.Sessions.
@@ -393,7 +384,7 @@ Ping () : bool
- Pings to the client of a WebSocketSharp.Server.WebSocketService instance. + Pings to the client of the WebSocketSharp.Server.WebSocketService instance.
@@ -405,7 +396,7 @@ Ping (string) : bool
- Pings with the specified string to the client of a WebSocketSharp.Server.WebSocketService instance. + Pings with the specified string to the client of the WebSocketSharp.Server.WebSocketService instance.
@@ -417,7 +408,8 @@ PingTo (string) : bool
- Pings to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID. + Pings to the client of the WebSocketSharp.Server.WebSocketService instance + associated with the specified id.
@@ -429,8 +421,8 @@ PingTo (string, string) : bool
- Pings with the specified string to the client of a WebSocketSharp.Server.WebSocketService instance - associated with the specified ID. + Pings with the specified string to the client of the WebSocketSharp.Server.WebSocketService instance + associated with the specified id.
@@ -442,7 +434,7 @@ Send (byte[])
- Sends a binary data to the client of a WebSocketSharp.Server.WebSocketService instance. + Sends a binary data to the client of the WebSocketSharp.Server.WebSocketService instance.
@@ -454,7 +446,7 @@ Send (string)
- Sends a text data to the client of a WebSocketSharp.Server.WebSocketService instance. + Sends a text data to the client of the WebSocketSharp.Server.WebSocketService instance.
@@ -466,7 +458,8 @@ SendTo (string, byte[])
- Sends a binary data to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID. + Sends a binary data to the client of the WebSocketSharp.Server.WebSocketService instance + associated with the specified id.
@@ -478,7 +471,8 @@ SendTo (string, string)
- Sends a text data to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID. + Sends a text data to the client of the WebSocketSharp.Server.WebSocketService instance + associated with the specified id.
@@ -490,7 +484,7 @@ Start ()
- Starts a WebSocketSharp.Server.WebSocketService instance. + Starts the WebSocketSharp.Server.WebSocketService instance.
@@ -502,7 +496,7 @@ Stop ()
- Stops a WebSocketSharp.Server.WebSocketService instance. + Stops the WebSocketSharp.Server.WebSocketService instance.
@@ -514,7 +508,7 @@ Stop (ushort, string)
- Stops a WebSocketSharp.Server.WebSocketService instance with the specified ushort and string. + Stops the WebSocketSharp.Server.WebSocketService instance with the specified ushort and string.
@@ -526,7 +520,7 @@ Stop (WebSocketSharp.CloseStatusCode, string)
- Stops a WebSocketSharp.Server.WebSocketService instance with the specified WebSocketSharp.CloseStatusCode and string. + Stops the WebSocketSharp.Server.WebSocketService instance with the specified WebSocketSharp.CloseStatusCode and string.
-
-
-
- - Bind - (WebSocketSharp.WebSocket, SessionManager)
- Binds the specified WebSocketSharp.WebSocket and WebSocketSharp.Server.SessionManager - to a WebSocketSharp.Server.WebSocketService instance. -
@@ -345,7 +332,8 @@ Broadcast (byte[])
- Broadcasts the specified array of byte to all clients of the WebSocket service. + Broadcasts the specified array of byte to the clients of every WebSocketSharp.Server.WebSocketService instances + in the WebSocketService.Sessions.
@@ -545,7 +539,7 @@ OnClose (WebSocketSharp.CloseEventArgs)
- Occurs when a inner WebSocketSharp.WebSocket receives a Close frame or the Stop method is called. + Occurs when the inner WebSocketSharp.WebSocket receives a Close frame or the Stop method is called.
@@ -557,7 +551,7 @@ OnError (WebSocketSharp.ErrorEventArgs)
- Occurs when a inner WebSocketSharp.WebSocket gets an error. + Occurs when the inner WebSocketSharp.WebSocket gets an error.
@@ -569,7 +563,7 @@ OnMessage (WebSocketSharp.MessageEventArgs)
- Occurs when a inner WebSocketSharp.WebSocket receives a data frame. + Occurs when the inner WebSocketSharp.WebSocket receives a data frame.
@@ -638,44 +632,11 @@ Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

-

Bind Method

-
-

- 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

-
-
-
- socket -
-
- A WebSocketSharp.WebSocket to bind to the WebSocketService. -
-
- sessions -
-
- A WebSocketSharp.Server.SessionManager to bind to the WebSocketService. -
-
-
-

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 array of byte to all clients of the WebSocket service. + Broadcasts the specified array of byte to the clients of every WebSocketSharp.Server.WebSocketService instances + in the WebSocketService.Sessions.

Syntax

public void Broadcast (byte[] data)
@@ -702,7 +663,8 @@

Broadcast Method

- Broadcasts the specified string to all clients of the WebSocket service. + Broadcasts the specified string to the clients of every WebSocketSharp.Server.WebSocketService instances + in the WebSocketService.Sessions.

Syntax

public void Broadcast (string data)
@@ -729,14 +691,15 @@

Broadping Method

- Pings to all clients of the WebSocket service. + Pings to the clients of every WebSocketSharp.Server.WebSocketService instances + in the WebSocketService.Sessions.

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. + A Dictionary<string, bool> that contains the collection of IDs and values + indicating whether each WebSocketSharp.Server.WebSocketService instances received a Pong in a time.

Remarks

@@ -750,7 +713,8 @@

Broadping Method

- Pings with the specified string to all clients of the WebSocket service. + Pings with the specified string to the clients of every WebSocketSharp.Server.WebSocketService instances + in the WebSocketService.Sessions.

Syntax

public Dictionary<string, bool> Broadping (string message)
@@ -767,8 +731,8 @@

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. + A Dictionary<string, bool> that contains the collection of IDs and values + indicating whether each WebSocketSharp.Server.WebSocketService instances received a Pong in a time.

Remarks

@@ -782,13 +746,13 @@

ID Property

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

Syntax

public string ID { get; }

Value

- A string that contains a ID. + A string that contains an ID.

Remarks

@@ -802,13 +766,13 @@

IsBound Property

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

Syntax

public bool IsBound { get; }

Value

- true if the WebSocketService is bound to a WebSocket; otherwise, false. + true if the WebSocketSharp.Server.WebSocketService instance is bound to a WebSocketSharp.WebSocket; otherwise, false.

Remarks

@@ -822,7 +786,7 @@

OnClose Method

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

Syntax

protected virtual void OnClose (WebSocketSharp.CloseEventArgs e)
@@ -849,7 +813,7 @@

OnError Method

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

Syntax

protected virtual void OnError (WebSocketSharp.ErrorEventArgs e)
@@ -876,7 +840,7 @@

OnMessage Method

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

Syntax

protected virtual void OnMessage (WebSocketSharp.MessageEventArgs e)
@@ -919,13 +883,13 @@

Ping Method

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

Syntax

public bool Ping ()

Returns

- true if the WebSocketService receives a Pong in a time; otherwise, false. + true if the WebSocketSharp.Server.WebSocketService instance receives a Pong in a time; otherwise, false.

Remarks

@@ -939,7 +903,7 @@

Ping Method

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

Syntax

public bool Ping (string message)
@@ -956,7 +920,7 @@

Returns

- true if the WebSocketService receives a Pong in a time; otherwise, false. + true if the WebSocketSharp.Server.WebSocketService instance receives a Pong in a time; otherwise, false.

Remarks

@@ -970,7 +934,8 @@

PingTo Method

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

Syntax

public bool PingTo (string id)
@@ -981,13 +946,13 @@ id
- A string that contains a ID that represents the destination for the Ping. + A string that contains an ID that represents the destination for the Ping.

Returns

- true if the WebSocket service receives a Pong in a time; otherwise, false. + true if the WebSocketSharp.Server.WebSocketService instance receives a Pong in a time; otherwise, false.

Remarks

@@ -1001,8 +966,8 @@

PingTo Method

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

Syntax

public bool PingTo (string id, string message)
@@ -1013,7 +978,7 @@ id
- A string that contains a ID that represents the destination for the Ping. + A string that contains an ID that represents the destination for the Ping.
message @@ -1025,7 +990,7 @@

Returns

- true if the WebSocketService receives a Pong in a time; otherwise, false. + true if the WebSocketSharp.Server.WebSocketService instance receives a Pong in a time; otherwise, false.

Remarks

@@ -1059,7 +1024,7 @@

Send Method

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

Syntax

public void Send (byte[] data)
@@ -1086,7 +1051,7 @@

Send Method

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

Syntax

public void Send (string data)
@@ -1113,7 +1078,8 @@

SendTo Method

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

Syntax

public void SendTo (string id, byte[] data)
@@ -1124,7 +1090,7 @@ id
- A string that contains a ID that represents the destination for the data. + A string that contains an ID that represents the destination for the data.
data @@ -1146,7 +1112,8 @@

SendTo Method

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

Syntax

public void SendTo (string id, string data)
@@ -1157,7 +1124,7 @@ id
- A string that contains a ID that represents the destination for the data. + A string that contains an ID that represents the destination for the data.
data @@ -1182,10 +1149,10 @@ Gets the sessions to the WebSocket service.

Syntax

-
protected SessionManager Sessions { get; }
+
protected WebSocketServiceManager Sessions { get; }

Value

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

Remarks

@@ -1199,7 +1166,7 @@

Start Method

- Starts a WebSocketSharp.Server.WebSocketService instance. + Starts the WebSocketSharp.Server.WebSocketService instance.

Syntax

public void Start ()
@@ -1215,7 +1182,7 @@

Stop Method

- Stops a WebSocketSharp.Server.WebSocketService instance. + Stops the WebSocketSharp.Server.WebSocketService instance.

Syntax

public void Stop ()
@@ -1231,7 +1198,7 @@

Stop Method

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

Syntax

public void Stop (ushort code, string reason)
@@ -1264,7 +1231,7 @@

Stop Method

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

Syntax

public void Stop (WebSocketSharp.CloseStatusCode code, string reason)
diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceHost`1.html b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceHost`1.html index 0f706268..95ebc3b7 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceHost`1.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceHost`1.html @@ -431,7 +431,7 @@ bool . - Gets or sets a value indicating whether the server cleans up the inactive client. + Gets or sets a value indicating whether the server cleans up the inactive clients periodically. @@ -618,7 +618,7 @@ - Binds the specified WebSocketSharp.WebSocket instance to the WebSocket service. + Binds the specified WebSocketSharp.WebSocket to the WebSocket service instance. @@ -838,7 +838,7 @@ address
- A System.Net.IPAddress that contains an IP address. + A System.Net.IPAddress that contains a local IP address.
port @@ -878,7 +878,7 @@ address
- A System.Net.IPAddress that contains an IP address. + A System.Net.IPAddress that contains a local IP address.
port @@ -923,7 +923,7 @@ context
- A WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext that contains a WebSocket connection. + A WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext that contains the WebSocket connection request objects.
@@ -983,8 +983,8 @@

Returns

- 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 Dictionary<string, bool> that contains the collection of session IDs and values + indicating whether the server received the Pongs from each clients in a time.

Remarks

@@ -1014,13 +1014,13 @@

Sweeped Property

- Gets or sets a value indicating whether the server cleans up the inactive client. + Gets or sets a value indicating whether the server cleans up the inactive clients periodically.

Syntax

public bool Sweeped { get; set; }

Value

- true if the server cleans up the inactive client; otherwise, false. + true if the server cleans up the inactive clients every 60 seconds; otherwise, false.

Remarks

@@ -1054,7 +1054,7 @@

WebSocketSharp.Server.IServiceHost.BindWebSocket Method

- Binds the specified WebSocketSharp.WebSocket instance to the WebSocket service. + Binds the specified WebSocketSharp.WebSocket to the WebSocket service instance.

Syntax

diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceManager.html b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceManager.html new file mode 100644 index 00000000..db610ae6 --- /dev/null +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/WebSocketServiceManager.html @@ -0,0 +1,672 @@ + + + WebSocketSharp.Server.WebSocketServiceManager + + + + + + + +

WebSocketServiceManager Class

+

+ Manages the collection of WebSocketSharp.Server.WebSocketService objects. +

+
+

Syntax

+
public class WebSocketServiceManager
+
+
+

Remarks

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

Requirements

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

Members

+
+

+ See Also: Inherited members from + object. +

+

Public Properties

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
[read-only]
+ + ActiveIDs + + + + IEnumerable<string> + . + Gets the collection of IDs of active WebSocketSharp.Server.WebSocketService objects + managed by the WebSocketSharp.Server.WebSocketServiceManager. +
[read-only]
+ + Count + + + + int + . + Gets the number of WebSocketSharp.Server.WebSocketService objects + managed by the WebSocketSharp.Server.WebSocketServiceManager. +
[read-only]
+ + IDs + + + + IEnumerable<string> + . + Gets the collection of IDs of WebSocketSharp.Server.WebSocketService objects + managed by the WebSocketSharp.Server.WebSocketServiceManager. +
[read-only]
+ + InactiveIDs + + + + IEnumerable<string> + . + Gets the collection of IDs of inactive WebSocketSharp.Server.WebSocketService objects + managed by the WebSocketSharp.Server.WebSocketServiceManager. +
[read-only]
+ + Sweeped + + + + bool + . + Gets a value indicating whether the WebSocketSharp.Server.WebSocketServiceManager cleans up + the inactive WebSocketSharp.Server.WebSocketService objects periodically. +
+
+
+

Public Methods

+
+
+ + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + Broadcast + (byte[])
+ Broadcasts the specified array of byte to the clients of every WebSocketSharp.Server.WebSocketService + managed by the WebSocketSharp.Server.WebSocketServiceManager. +
+
+
+
+ + Broadcast + (string)
+ Broadcasts the specified string to the clients of every WebSocketSharp.Server.WebSocketService + managed by the WebSocketSharp.Server.WebSocketServiceManager. +
+
+
+
+ + Broadping + (string) : Dictionary<string, bool>
+ Pings with the specified string to the clients of every WebSocketSharp.Server.WebSocketService + managed by the WebSocketSharp.Server.WebSocketServiceManager. +
+
+
+
+ + Sweep + ()
+ Cleans up the inactive WebSocketSharp.Server.WebSocketService objects. +
+
+
+
+ + TryGetWebSocketService + (string, out WebSocketService) : bool
+ Tries to get the WebSocketSharp.Server.WebSocketService associated with the specified id. +
+
+
+

Extension Methods

+
+
+ + + + + + + + + +
+
static
+
+ + IsNull<T> + (this T) : bool
+ Determines whether the specified object is null. +
+
static
+
+ + IsNullDo<T> + (this T, Action) : bool
+ Determines whether the specified object is null. + And invokes the specified Action delegate if the specified object is null. +
+
+
+
+
+
+

Member Details

+
+

ActiveIDs Property

+
+

+ Gets the collection of IDs of active WebSocketSharp.Server.WebSocketService objects + managed by the WebSocketSharp.Server.WebSocketServiceManager. +

+

Syntax

+
public IEnumerable<string> ActiveIDs { get; }
+

Value

+
+ An IEnumerable<string> that contains the collection of IDs of active WebSocketSharp.Server.WebSocketService objects. +
+

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 array of byte to the clients of every WebSocketSharp.Server.WebSocketService + managed by the WebSocketSharp.Server.WebSocketServiceManager. +

+

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 the clients of every WebSocketSharp.Server.WebSocketService + managed by the WebSocketSharp.Server.WebSocketServiceManager. +

+

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 with the specified string to the clients of every WebSocketSharp.Server.WebSocketService + managed by the WebSocketSharp.Server.WebSocketServiceManager. +

+

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 IDs and values + indicating whether each WebSocketSharp.Server.WebSocketService 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)
+
+
+

Count Property

+
+

+ Gets the number of WebSocketSharp.Server.WebSocketService objects + managed by the WebSocketSharp.Server.WebSocketServiceManager. +

+

Syntax

+
public int Count { get; }
+

Value

+
+ An int that contains the number of WebSocketSharp.Server.WebSocketService objects + managed by the WebSocketSharp.Server.WebSocketServiceManager. +
+

Remarks

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

Requirements

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

IDs Property

+
+

+ Gets the collection of IDs of WebSocketSharp.Server.WebSocketService objects + managed by the WebSocketSharp.Server.WebSocketServiceManager. +

+

Syntax

+
public IEnumerable<string> IDs { get; }
+

Value

+
+ An IEnumerable<string> that contains the collection of IDs of WebSocketSharp.Server.WebSocketService objects. +
+

Remarks

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

Requirements

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

InactiveIDs Property

+
+

+ Gets the collection of IDs of inactive WebSocketSharp.Server.WebSocketService objects + managed by the WebSocketSharp.Server.WebSocketServiceManager. +

+

Syntax

+
public IEnumerable<string> InactiveIDs { get; }
+

Value

+
+ An IEnumerable<string> that contains the collection of IDs of inactive WebSocketSharp.Server.WebSocketService objects. +
+

Remarks

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

Requirements

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

Sweep Method

+
+

+ Cleans up the inactive WebSocketSharp.Server.WebSocketService objects. +

+

Syntax

+
public void Sweep ()
+

Remarks

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

Requirements

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

Sweeped Property

+
+

+ Gets a value indicating whether the WebSocketSharp.Server.WebSocketServiceManager cleans up + the inactive WebSocketSharp.Server.WebSocketService objects periodically. +

+

Syntax

+
public bool Sweeped { get; }
+

Value

+
+ true if the WebSocketSharp.Server.WebSocketServiceManager cleans up the inactive WebSocketSharp.Server.WebSocketService objects + every 60 seconds; otherwise, false. +
+

Remarks

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

Requirements

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

TryGetWebSocketService Method

+
+

+ Tries to get the WebSocketSharp.Server.WebSocketService associated with the specified id. +

+

Syntax

+
public bool TryGetWebSocketService (string id, out WebSocketService service)
+

Parameters

+
+
+
+ id +
+
+ A string that contains the ID to find. +
+
+ service +
+
+ When this method returns, contains the WebSocketSharp.Server.WebSocketService with the specified id, if the id is found; otherwise, null. +
+
+
+

Returns

+
+ true if the WebSocketSharp.Server.WebSocketServiceManager manages the WebSocketSharp.Server.WebSocketService with the specified id; otherwise, false. +
+

Remarks

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

Requirements

+
+ Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/websocket-sharp/doc/html/WebSocketSharp.Server/index.html b/websocket-sharp/doc/html/WebSocketSharp.Server/index.html index 9ffd2896..ba1d55b3 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Server/index.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Server/index.html @@ -196,7 +196,7 @@

Namespace

-

The WebSocketSharp.Server namespace provides the functions of the server that receives the WebSocket connection requests.

+

The WebSocketSharp.Server namespace contains classes to implement the server that receives the WebSocket connection requests.

@@ -226,14 +226,6 @@ Documentation for this section has not yet been entered. - - - - + + + +
Type
- SessionManager - - Documentation for this section has not yet been entered. -
WebSocketServer @@ -266,6 +258,14 @@ Provides the functions of the server that receives the WebSocket connection requests.
+ WebSocketServiceManager + + Manages the collection of WebSocketSharp.Server.WebSocketService objects. +
diff --git a/websocket-sharp/doc/html/WebSocketSharp/index.html b/websocket-sharp/doc/html/WebSocketSharp/index.html index 4999c417..9baaa747 100644 --- a/websocket-sharp/doc/html/WebSocketSharp/index.html +++ b/websocket-sharp/doc/html/WebSocketSharp/index.html @@ -196,7 +196,7 @@

Namespace

-

The WebSocketSharp namespace provides an implementation of the WebSocket interface.

+

The WebSocketSharp namespace contains classes and enumerations to implement the WebSocket interface.

diff --git a/websocket-sharp/doc/html/index.html b/websocket-sharp/doc/html/index.html index 22c62e0f..d8bbfda0 100644 --- a/websocket-sharp/doc/html/index.html +++ b/websocket-sharp/doc/html/index.html @@ -190,7 +190,7 @@

websocket-sharp

-

A C# implementation of WebSocket protocol client & server.
+
A C# implementation of the WebSocket protocol client & server.

@@ -198,7 +198,7 @@

WebSocketSharp Namespace

-

The WebSocketSharp namespace provides an implementation of the WebSocket interface.

+

The WebSocketSharp namespace contains classes and enumerations to implement the WebSocket interface.

Type
@@ -288,7 +288,7 @@

WebSocketSharp.Net Namespace

-

The WebSocketSharp.Net namespace provides some modified classes in the System.Net namespace (e.g. System.Net.HttpListenerContext) to accept the WebSocket connection request.

+

The WebSocketSharp.Net namespace contains some modified classes and enumerations in the System.Net namespace (e.g. System.Net.HttpListenerContext) to accept the WebSocket connection requests.

Type
@@ -410,7 +410,7 @@

WebSocketSharp.Net.WebSockets Namespace

-

The WebSocketSharp.Net.WebSockets namespace provides access to the WebSocket connection request objects sent from the client to the server.

+

The WebSocketSharp.Net.WebSockets namespace contains classes to access to the WebSocket connection request objects.

Type
@@ -444,7 +444,7 @@

WebSocketSharp.Server Namespace

-

The WebSocketSharp.Server namespace provides the functions of the server that receives the WebSocket connection requests.

+

The WebSocketSharp.Server namespace contains classes to implement the server that receives the WebSocket connection requests.

Type
@@ -474,14 +474,6 @@ Documentation for this section has not yet been entered. - - - - + + + +
Type
- SessionManager - - Documentation for this section has not yet been entered. -
WebSocketServer @@ -514,6 +506,14 @@ Provides the functions of the server that receives the WebSocket connection requests.
+ WebSocketServiceManager + + Manages the collection of WebSocketSharp.Server.WebSocketService objects. +
diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/IServiceHost.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/IServiceHost.xml index 274d20e3..79c90f42 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/IServiceHost.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/IServiceHost.xml @@ -24,10 +24,10 @@ - An to bind. + A to bind. - Binds the specified instance to the WebSocket service. + Binds the specified to the WebSocket service instance. To be added. @@ -47,7 +47,7 @@ A to broadcast. - Broadcasts the specified . + Broadcasts the specified to all service clients. To be added. @@ -91,10 +91,10 @@ - Gets or sets a value indicating whether the WebSocket service host cleans up the inactive service client. + Gets or sets a value indicating whether the WebSocket service host cleans up the inactive service clients periodically. - true if the WebSocket service host cleans up the inactive service client; otherwise, false. + true if the WebSocket service host cleans up the inactive service clients periodically; otherwise, false. To be added. diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/SessionManager.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/SessionManager.xml.remove similarity index 100% rename from websocket-sharp/doc/mdoc/WebSocketSharp.Server/SessionManager.xml rename to websocket-sharp/doc/mdoc/WebSocketSharp.Server/SessionManager.xml.remove diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServer.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServer.xml index c7e6b982..29e0b8af 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServer.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServer.xml @@ -97,7 +97,7 @@ - A that contains an IP address. + A that contains a local IP address. An that contains a port number. @@ -120,7 +120,7 @@ - A that contains an IP address. + A that contains a local IP address. An that contains a port number. @@ -147,7 +147,7 @@ - A that contains a WebSocket connection. + A that contains the WebSocket connection request objects. Accepts a WebSocket connection. @@ -175,10 +175,10 @@ - The type of a WebSocket service. The T must inherit the class. + The type of the WebSocket service. The T must inherit the class. - A that contains an absolute path associated with a WebSocket service. + A that contains an absolute path associated with the WebSocket service. Adds a WebSocket service. @@ -215,10 +215,10 @@ - Gets the paths associated with the each WebSocket services. + Gets the collection of paths associated with the every WebSocket services that the server provides. - An IEnumerable<string> that contains the paths. + An IEnumerable<string> that contains the collection of paths. To be added. @@ -247,10 +247,10 @@ - Gets or sets a value indicating whether the server cleans up the inactive client. + Gets or sets a value indicating whether the server cleans up the inactive clients periodically. - true if the server cleans up the inactive client; otherwise, false. + true if the server cleans up the inactive clients every 60 seconds; otherwise, false. To be added. diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServerBase.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServerBase.xml index a539e1af..4375213e 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServerBase.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServerBase.xml @@ -65,7 +65,7 @@ - A that contains an IP address. + A that contains a local IP address. An that contains a port number. @@ -109,7 +109,7 @@ - A that contains a WebSocket connection. + A that contains the WebSocket connection request objects. Accepts a WebSocket connection. @@ -126,10 +126,10 @@ - Gets the IP address on which to listen for incoming connection attempts. + Gets the local IP address on which to listen for incoming connection attempts. - A that contains an IP address. + A that contains a local IP address. To be added. @@ -180,10 +180,10 @@ - Gets a value indicating whether this server provides secure connection. + Gets a value indicating whether the server provides secure connection. - true if this server provides secure connection; otherwise, false. + true if the server provides secure connection; otherwise, false. To be added. @@ -197,10 +197,10 @@ - Gets a value indicating whether this server is self host. + Gets a value indicating whether the server is self host. - true if this server is self host; otherwise, false. + true if the server is self host; 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 30fd92e0..d9ffbc72 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketService.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketService.xml @@ -29,31 +29,6 @@ To be added. - - - - Method - - System.Void - - - - - - - - A to bind to the WebSocketService. - - - A to bind to the WebSocketService. - - - Binds the specified and - to a instance. - - To be added. - - @@ -69,7 +44,8 @@ An array of to broadcast. - Broadcasts the specified array of to all clients of the WebSocket service. + Broadcasts the specified array of to the clients of every instances + in the . To be added. @@ -89,7 +65,8 @@ A to broadcast. - Broadcasts the specified to all clients of the WebSocket service. + Broadcasts the specified to the clients of every instances + in the . To be added. @@ -104,11 +81,12 @@ - Pings to all clients of the WebSocket service. + Pings to the clients of every instances + in the . - 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 Dictionary<string, bool> that contains the collection of IDs and values + indicating whether each instances received a Pong in a time. To be added. @@ -128,11 +106,12 @@ A that contains a message. - Pings with the specified to all clients of the WebSocket service. + Pings with the specified to the clients of every instances + in the . - 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 Dictionary<string, bool> that contains the collection of IDs and values + indicating whether each instances received a Pong in a time. To be added. @@ -146,10 +125,10 @@ - Gets the ID of a instance. + Gets the ID of the instance. - A that contains a ID. + A that contains an ID. To be added. @@ -163,10 +142,10 @@ - Gets a value indicating whether a instance is bound to a . + Gets a value indicating whether the instance is bound to a . - true if the WebSocketService is bound to a WebSocket; otherwise, false. + true if the instance is bound to a ; otherwise, false. To be added. @@ -186,7 +165,7 @@ A that contains the event data associated with a event. - Occurs when a inner receives a Close frame or the Stop method is called. + Occurs when the inner receives a Close frame or the Stop method is called. To be added. @@ -206,7 +185,7 @@ An that contains the event data associated with a event. - Occurs when a inner gets an error. + Occurs when the inner gets an error. To be added. @@ -226,7 +205,7 @@ A that contains the event data associated with a event. - Occurs when a inner receives a data frame. + Occurs when the inner receives a data frame. To be added. @@ -256,10 +235,10 @@ - Pings to the client of a instance. + Pings to the client of the instance. - true if the WebSocketService receives a Pong in a time; otherwise, false. + true if the instance receives a Pong in a time; otherwise, false. To be added. @@ -279,10 +258,10 @@ A that contains a message. - Pings with the specified to the client of a instance. + Pings with the specified to the client of the instance. - true if the WebSocketService receives a Pong in a time; otherwise, false. + true if the instance receives a Pong in a time; otherwise, false. To be added. @@ -299,13 +278,14 @@ - A that contains a ID that represents the destination for the Ping. + A that contains an ID that represents the destination for the Ping. - Pings to the client of a instance associated with the specified ID. + Pings to the client of the instance + associated with the specified . - true if the WebSocket service receives a Pong in a time; otherwise, false. + true if the instance receives a Pong in a time; otherwise, false. To be added. @@ -323,17 +303,17 @@ - A that contains a ID that represents the destination for the Ping. + A that contains an 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. + Pings with the specified to the client of the instance + associated with the specified . - true if the WebSocketService receives a Pong in a time; otherwise, false. + true if the instance receives a Pong in a time; otherwise, false. To be added. @@ -370,7 +350,7 @@ An array of that contains a binary data to send. - Sends a binary data to the client of a instance. + Sends a binary data to the client of the instance. To be added. @@ -390,7 +370,7 @@ A that contains a text data to send. - Sends a text data to the client of a instance. + Sends a text data to the client of the instance. To be added. @@ -408,13 +388,14 @@ - A that contains a ID that represents the destination for the data. + A that contains an 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. + Sends a binary data to the client of the instance + associated with the specified . To be added. @@ -432,30 +413,31 @@ - A that contains a ID that represents the destination for the data. + A that contains an 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. + Sends a text data to the client of the instance + associated with the specified . To be added. - - + + Property - WebSocketSharp.Server.SessionManager + WebSocketSharp.Server.WebSocketServiceManager Gets the sessions to the WebSocket service. - A that contains the sessions to the WebSocket service. + A that contains the sessions to the WebSocket service. To be added. @@ -470,7 +452,7 @@ - Starts a instance. + Starts the instance. To be added. @@ -485,7 +467,7 @@ - Stops a instance. + Stops the instance. To be added. @@ -509,7 +491,7 @@ A that contains a reason for stop. - Stops a instance with the specified and . + Stops the instance with the specified and . To be added. @@ -533,7 +515,7 @@ A that contains a reason for stop. - Stops a instance with the specified and . + Stops the 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 719a4f21..ecc0cc85 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServiceHost`1.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServiceHost`1.xml @@ -149,7 +149,7 @@ - A that contains an IP address. + A that contains a local IP address. An that contains a port number. @@ -176,7 +176,7 @@ - A that contains an IP address. + A that contains a local IP address. An that contains a port number. @@ -206,7 +206,7 @@ - A that contains a WebSocket connection. + A that contains the WebSocket connection request objects. Accepts a WebSocket connection. @@ -252,8 +252,8 @@ 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 Dictionary<string, bool> that contains the collection of session IDs and values + indicating whether the server received the Pongs from each clients in a time. To be added. @@ -282,10 +282,10 @@ - Gets or sets a value indicating whether the server cleans up the inactive client. + Gets or sets a value indicating whether the server cleans up the inactive clients periodically. - true if the server cleans up the inactive client; otherwise, false. + true if the server cleans up the inactive clients every 60 seconds; otherwise, false. To be added. @@ -322,7 +322,7 @@ A to bind. - Binds the specified instance to the WebSocket service. + Binds the specified to the WebSocket service instance. To be added. diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServiceManager.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServiceManager.xml new file mode 100644 index 00000000..d3748c47 --- /dev/null +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Server/WebSocketServiceManager.xml @@ -0,0 +1,220 @@ + + + + + websocket-sharp + + + System.Object + + + + + Manages the collection of objects. + + To be added. + + + + + + Property + + System.Collections.Generic.IEnumerable<System.String> + + + + Gets the collection of IDs of active objects + managed by the . + + + An IEnumerable<string> that contains the collection of IDs of active objects. + + To be added. + + + + + + Method + + System.Void + + + + + + + An array of to broadcast. + + + Broadcasts the specified array of to the clients of every + managed by the . + + To be added. + + + + + + Method + + System.Void + + + + + + + A to broadcast. + + + Broadcasts the specified to the clients of every + managed by the . + + To be added. + + + + + + Method + + System.Collections.Generic.Dictionary<System.String,System.Boolean> + + + + + + + A that contains a message. + + + Pings with the specified to the clients of every + managed by the . + + + A Dictionary<string, bool> that contains the collection of IDs and values + indicating whether each received a Pong in a time. + + To be added. + + + + + + Property + + System.Int32 + + + + Gets the number of objects + managed by the . + + + An that contains the number of objects + managed by the . + + To be added. + + + + + + Property + + System.Collections.Generic.IEnumerable<System.String> + + + + Gets the collection of IDs of objects + managed by the . + + + An IEnumerable<string> that contains the collection of IDs of objects. + + To be added. + + + + + + Property + + System.Collections.Generic.IEnumerable<System.String> + + + + Gets the collection of IDs of inactive objects + managed by the . + + + An IEnumerable<string> that contains the collection of IDs of inactive objects. + + To be added. + + + + + + Method + + System.Void + + + + + Cleans up the inactive objects. + + To be added. + + + + + + Property + + System.Boolean + + + + Gets a value indicating whether the cleans up + the inactive objects periodically. + + + true if the cleans up the inactive objects + every 60 seconds; otherwise, false. + + To be added. + + + + + + Method + + System.Boolean + + + + + + + + A that contains the ID to find. + + + When this method returns, contains the with the specified , if the is found; otherwise, . + + + Tries to get the associated with the specified . + + + true if the manages the with the specified ; otherwise, false. + + To be added. + + + + diff --git a/websocket-sharp/doc/mdoc/index.xml b/websocket-sharp/doc/mdoc/index.xml index 9a69216d..911504fc 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 ] @@ -13,7 +13,7 @@ System.Reflection.AssemblyCopyright("sta.blockhead") - System.Reflection.AssemblyDescription("A C# implementation of WebSocket protocol client & server") + System.Reflection.AssemblyDescription("A C# implementation of the WebSocket protocol client & server") System.Reflection.AssemblyProduct("websocket-sharp.dll") @@ -30,7 +30,7 @@ - A C# implementation of WebSocket protocol client & server. + A C# implementation of the WebSocket protocol client & server. Copyright (c) 2010-2013 sta.blockhead @@ -70,11 +70,11 @@ - + websocket-sharp diff --git a/websocket-sharp/doc/mdoc/ns-WebSocketSharp.Net.WebSockets.xml b/websocket-sharp/doc/mdoc/ns-WebSocketSharp.Net.WebSockets.xml index e694b9a4..603e826b 100644 --- a/websocket-sharp/doc/mdoc/ns-WebSocketSharp.Net.WebSockets.xml +++ b/websocket-sharp/doc/mdoc/ns-WebSocketSharp.Net.WebSockets.xml @@ -1,6 +1,6 @@ To be added. - The WebSocketSharp.Net.WebSockets namespace provides access to the WebSocket connection request objects sent from the client to the server. + The WebSocketSharp.Net.WebSockets namespace contains classes to access to the WebSocket connection request objects. diff --git a/websocket-sharp/doc/mdoc/ns-WebSocketSharp.Net.xml b/websocket-sharp/doc/mdoc/ns-WebSocketSharp.Net.xml index 900265c2..c5a1e31c 100644 --- a/websocket-sharp/doc/mdoc/ns-WebSocketSharp.Net.xml +++ b/websocket-sharp/doc/mdoc/ns-WebSocketSharp.Net.xml @@ -1,6 +1,6 @@ To be added. - The WebSocketSharp.Net namespace provides some modified classes in the System.Net namespace (e.g. ) to accept the WebSocket connection request. + The WebSocketSharp.Net namespace contains some modified classes and enumerations in the System.Net namespace (e.g. ) to accept the WebSocket connection requests. diff --git a/websocket-sharp/doc/mdoc/ns-WebSocketSharp.Server.xml b/websocket-sharp/doc/mdoc/ns-WebSocketSharp.Server.xml index 6b67dda9..563ee285 100644 --- a/websocket-sharp/doc/mdoc/ns-WebSocketSharp.Server.xml +++ b/websocket-sharp/doc/mdoc/ns-WebSocketSharp.Server.xml @@ -1,6 +1,6 @@ To be added. - The WebSocketSharp.Server namespace provides the functions of the server that receives the WebSocket connection requests. + The WebSocketSharp.Server namespace contains classes to implement the server that receives the WebSocket connection requests. diff --git a/websocket-sharp/doc/mdoc/ns-WebSocketSharp.xml b/websocket-sharp/doc/mdoc/ns-WebSocketSharp.xml index 9dd7c006..9c02bf33 100644 --- a/websocket-sharp/doc/mdoc/ns-WebSocketSharp.xml +++ b/websocket-sharp/doc/mdoc/ns-WebSocketSharp.xml @@ -1,6 +1,6 @@ To be added. - The WebSocketSharp namespace provides an implementation of the WebSocket interface. + The WebSocketSharp namespace contains classes and enumerations to implement the WebSocket interface. diff --git a/websocket-sharp/websocket-sharp.csproj b/websocket-sharp/websocket-sharp.csproj index 5b610627..082f197d 100644 --- a/websocket-sharp/websocket-sharp.csproj +++ b/websocket-sharp/websocket-sharp.csproj @@ -107,7 +107,6 @@ - @@ -120,6 +119,7 @@ + diff --git a/websocket-sharp/websocket-sharp.pidb b/websocket-sharp/websocket-sharp.pidb index 197c274a..c442e071 100644 Binary files a/websocket-sharp/websocket-sharp.pidb and b/websocket-sharp/websocket-sharp.pidb differ