diff --git a/websocket-sharp/Server/WebSocketSessionManager.cs b/websocket-sharp/Server/WebSocketSessionManager.cs index df305ded..1e58787b 100644 --- a/websocket-sharp/Server/WebSocketSessionManager.cs +++ b/websocket-sharp/Server/WebSocketSessionManager.cs @@ -170,8 +170,8 @@ namespace WebSocketSharp.Server } /// - /// Gets a value indicating whether the manager cleans up the inactive sessions - /// in the WebSocket service periodically. + /// Gets a value indicating whether the manager cleans up the inactive sessions in + /// the WebSocket service periodically. /// /// /// true if the manager cleans up the inactive sessions every 60 seconds; @@ -292,14 +292,14 @@ namespace WebSocketSharp.Server private bool tryGetSession (string id, out IWebSocketSession session) { - bool res; + bool ret; lock (_sync) - res = _sessions.TryGetValue (id, out session); + ret = _sessions.TryGetValue (id, out session); - if (!res) - _logger.Error ("A session with the specified ID isn't found.\nID: " + id); + if (!ret) + _logger.Error ("A session with the specified ID isn't found:\n ID: " + id); - return res; + return ret; } #endregion @@ -343,15 +343,15 @@ namespace WebSocketSharp.Server internal Dictionary Broadping (byte[] frameAsBytes, TimeSpan timeout) { - var res = new Dictionary (); + var ret = new Dictionary (); foreach (var session in Sessions) { if (_state != ServerState.Start) break; - res.Add (session.ID, session.Context.WebSocket.Ping (frameAsBytes, timeout)); + ret.Add (session.ID, session.Context.WebSocket.Ping (frameAsBytes, timeout)); } - return res; + return ret; } internal bool Remove (string id) @@ -386,10 +386,10 @@ namespace WebSocketSharp.Server #region Public Methods /// - /// Broadcasts a binary to every client in the WebSocket service. + /// Sends binary to every client in the WebSocket service. /// /// - /// An array of that represents the binary data to broadcast. + /// An array of that represents the binary data to send. /// public void Broadcast (byte[] data) { @@ -406,10 +406,10 @@ namespace WebSocketSharp.Server } /// - /// Broadcasts a text to every client in the WebSocket service. + /// Sends text to every client in the WebSocket service. /// /// - /// A that represents the text data to broadcast. + /// A that represents the text data to send. /// public void Broadcast (string data) { @@ -419,26 +419,26 @@ namespace WebSocketSharp.Server return; } - var rawData = Encoding.UTF8.GetBytes (data); - if (rawData.LongLength <= WebSocket.FragmentLength) - broadcast (Opcode.Text, rawData, null); + var bytes = Encoding.UTF8.GetBytes (data); + if (bytes.LongLength <= WebSocket.FragmentLength) + broadcast (Opcode.Text, bytes, null); else - broadcast (Opcode.Text, new MemoryStream (rawData), null); + broadcast (Opcode.Text, new MemoryStream (bytes), null); } /// - /// Broadcasts a binary asynchronously to every client - /// in the WebSocket service. + /// Sends binary asynchronously to every client in + /// the WebSocket service. /// /// - /// This method doesn't wait for the broadcast to be complete. + /// This method doesn't wait for the send to be complete. /// /// - /// An array of that represents the binary data to broadcast. + /// An array of that represents the binary data to send. /// /// /// An delegate that references the method(s) called when - /// the broadcast is complete. + /// the send is complete. /// public void BroadcastAsync (byte[] data, Action completed) { @@ -455,18 +455,18 @@ namespace WebSocketSharp.Server } /// - /// Broadcasts a text asynchronously to every client - /// in the WebSocket service. + /// Sends text asynchronously to every client in + /// the WebSocket service. /// /// - /// This method doesn't wait for the broadcast to be complete. + /// This method doesn't wait for the send to be complete. /// /// - /// A that represents the text data to broadcast. + /// A that represents the text data to send. /// /// /// An delegate that references the method(s) called when - /// the broadcast is complete. + /// the send is complete. /// public void BroadcastAsync (string data, Action completed) { @@ -476,29 +476,29 @@ namespace WebSocketSharp.Server return; } - var rawData = Encoding.UTF8.GetBytes (data); - if (rawData.LongLength <= WebSocket.FragmentLength) - broadcastAsync (Opcode.Text, rawData, completed); + var bytes = Encoding.UTF8.GetBytes (data); + if (bytes.LongLength <= WebSocket.FragmentLength) + broadcastAsync (Opcode.Text, bytes, completed); else - broadcastAsync (Opcode.Text, new MemoryStream (rawData), completed); + broadcastAsync (Opcode.Text, new MemoryStream (bytes), completed); } /// - /// Broadcasts a binary data from the specified asynchronously - /// to every client in the WebSocket service. + /// Sends binary data from the specified asynchronously to + /// every client in the WebSocket service. /// /// - /// This method doesn't wait for the broadcast to be complete. + /// This method doesn't wait for the send to be complete. /// /// - /// A from which contains the binary data to broadcast. + /// A from which contains the binary data to send. /// /// - /// An that represents the number of bytes to broadcast. + /// An that represents the number of bytes to send. /// /// /// An delegate that references the method(s) called when - /// the broadcast is complete. + /// the send is complete. /// public void BroadcastAsync (Stream stream, int length, Action completed) { @@ -523,7 +523,7 @@ namespace WebSocketSharp.Server if (len < length) _logger.Warn ( String.Format ( - "The data with 'length' cannot be read from 'stream'.\nexpected: {0} actual: {1}", + "The data with 'length' cannot be read from 'stream':\n expected: {0}\n actual: {1}", length, len)); @@ -555,8 +555,8 @@ namespace WebSocketSharp.Server } /// - /// Sends a Ping with the specified to every client - /// in the WebSocket service. + /// Sends a Ping with the specified to every client in + /// the WebSocket service. /// /// /// A Dictionary<string, bool> that contains a collection of pairs of @@ -654,8 +654,8 @@ namespace WebSocketSharp.Server } /// - /// Sends a Ping with the specified to the client - /// on the session with the specified . + /// Sends a Ping with the specified to the client on + /// the session with the specified . /// /// /// true if the manager receives a Pong from the client in a time; @@ -674,8 +674,8 @@ namespace WebSocketSharp.Server } /// - /// Sends a binary to the client on the session - /// with the specified . + /// Sends binary to the client on the session with + /// the specified . /// /// /// An array of that represents the binary data to send. @@ -691,8 +691,8 @@ namespace WebSocketSharp.Server } /// - /// Sends a text to the client on the session - /// with the specified . + /// Sends text to the client on the session with + /// the specified . /// /// /// A that represents the text data to send. @@ -708,8 +708,8 @@ namespace WebSocketSharp.Server } /// - /// Sends a binary asynchronously to the client on the session - /// with the specified . + /// Sends binary asynchronously to the client on + /// the session with the specified . /// /// /// This method doesn't wait for the send to be complete. @@ -733,8 +733,8 @@ namespace WebSocketSharp.Server } /// - /// Sends a text asynchronously to the client on the session - /// with the specified . + /// Sends text asynchronously to the client on + /// the session with the specified . /// /// /// This method doesn't wait for the send to be complete. @@ -758,8 +758,8 @@ namespace WebSocketSharp.Server } /// - /// Sends a binary data from the specified asynchronously - /// to the client on the session with the specified . + /// Sends binary data from the specified asynchronously to + /// the client on the session with the specified . /// /// /// This method doesn't wait for the send to be complete.