From d3410a3ac43e4af51a13e31c6141c24bae44c012 Mon Sep 17 00:00:00 2001 From: sta Date: Thu, 2 Jul 2015 17:54:16 +0900 Subject: [PATCH] Refactored a few for WebSocket.cs --- websocket-sharp/WebSocket.cs | 44 ++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index 4dc519dc..5ca12842 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -509,9 +509,7 @@ namespace WebSocketSharp /// public Uri Url { get { - return _client - ? _uri - : _context.RequestUri; + return _client ? _uri : _context.RequestUri; } } @@ -897,9 +895,7 @@ namespace WebSocketSharp private MessageEventArgs dequeueFromMessageEventQueue () { lock (_forMessageEventQueue) - return _messageEventQueue.Count > 0 - ? _messageEventQueue.Dequeue () - : null; + return _messageEventQueue.Count > 0 ? _messageEventQueue.Dequeue () : null; } // As client @@ -1223,8 +1219,7 @@ namespace WebSocketSharp else buff = new byte[rem]; - return stream.Read (buff, 0, rem) == rem && - send (Fin.Final, Opcode.Cont, buff, compressed); + return stream.Read (buff, 0, rem) == rem && send (Fin.Final, Opcode.Cont, buff, compressed); } private bool send (Fin fin, Opcode opcode, byte[] data, bool compressed) @@ -1767,8 +1762,7 @@ namespace WebSocketSharp /// the allowable range of the close status code. /// /// - /// A that represents the status code indicating the reason for - /// the close. + /// A that represents the status code indicating the reason for the close. /// public void Close (ushort code) { @@ -1946,8 +1940,8 @@ namespace WebSocketSharp /// This method doesn't wait for the close to be complete. /// /// - /// One of the enum values, represents - /// the status code indicating the reason for the close. + /// One of the enum values, represents the status code indicating + /// the reason for the close. /// public void CloseAsync (CloseStatusCode code) { @@ -2022,8 +2016,8 @@ namespace WebSocketSharp /// /// /// - /// One of the enum values, represents - /// the status code indicating the reason for the close. + /// One of the enum values, represents the status code indicating + /// the reason for the close. /// /// /// A that represents the reason for the close. @@ -2331,8 +2325,8 @@ namespace WebSocketSharp } /// - /// Sets an HTTP to send with the WebSocket connection request to - /// the server. + /// Sets an HTTP to send with + /// the WebSocket connection request to the server. /// /// /// A that represents the cookie to send. @@ -2361,12 +2355,12 @@ namespace WebSocketSharp /// A that represents the user name used to authenticate. /// /// - /// A that represents the password for - /// used to authenticate. + /// A that represents the password for used + /// to authenticate. /// /// - /// true if the sends the Basic authentication credentials - /// with the first connection request to the server; otherwise, false. + /// true if the sends the Basic authentication credentials with + /// the first connection request to the server; otherwise, false. /// public void SetCredentials (string username, string password, bool preAuth) { @@ -2401,9 +2395,9 @@ namespace WebSocketSharp } /// - /// Sets an HTTP Proxy server URL to connect through, and if necessary, a pair of - /// and for the proxy server - /// authentication (Basic/Digest). + /// Sets an HTTP Proxy server URL to connect through, and if necessary, + /// a pair of and for + /// the proxy server authentication (Basic/Digest). /// /// /// A that represents the proxy server URL to connect through. @@ -2412,8 +2406,8 @@ namespace WebSocketSharp /// A that represents the user name used to authenticate. /// /// - /// A that represents the password for - /// used to authenticate. + /// A that represents the password for used + /// to authenticate. /// public void SetProxy (string url, string username, string password) {