diff options
| author | Erwin de Haan <EraYaN@users.noreply.github.com> | 2019-01-17 17:48:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-17 17:48:01 +0100 |
| commit | e241589969c643116f9fc5c24bcf2009fed83fe5 (patch) | |
| tree | 5a9e7d266b5f79c6d90a4767e804887b40b87b1c /SocketHttpListener/Net/WebSockets/HttpWebSocket.cs | |
| parent | 47f08fbb12db5854f5e474ddbf70b758ca084616 (diff) | |
| parent | 7aa975325af87fe425fe143aaed1df830133be8b (diff) | |
Merge branch 'dev' into skia-native-arm
Diffstat (limited to 'SocketHttpListener/Net/WebSockets/HttpWebSocket.cs')
| -rw-r--r-- | SocketHttpListener/Net/WebSockets/HttpWebSocket.cs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/SocketHttpListener/Net/WebSockets/HttpWebSocket.cs b/SocketHttpListener/Net/WebSockets/HttpWebSocket.cs index 9dc9143f8..f72a139f3 100644 --- a/SocketHttpListener/Net/WebSockets/HttpWebSocket.cs +++ b/SocketHttpListener/Net/WebSockets/HttpWebSocket.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Text; using System.Diagnostics.CodeAnalysis; @@ -30,7 +30,7 @@ namespace SocketHttpListener.Net.WebSockets return retVal; } - // return value here signifies if a Sec-WebSocket-Protocol header should be returned by the server. + // return value here signifies if a Sec-WebSocket-Protocol header should be returned by the server. internal static bool ProcessWebSocketProtocolHeader(string clientSecWebSocketProtocol, string subProtocol, out string acceptProtocol) @@ -44,7 +44,7 @@ namespace SocketHttpListener.Net.WebSockets // If the server specified _anything_ this isn't valid. throw new WebSocketException("UnsupportedProtocol"); } - // Treat empty and null from the server as the same thing here, server should not send headers. + // Treat empty and null from the server as the same thing here, server should not send headers. return false; } @@ -52,7 +52,7 @@ namespace SocketHttpListener.Net.WebSockets if (subProtocol == null) { - // client specified some protocols, server specified 'null'. So server should send headers. + // client specified some protocols, server specified 'null'. So server should send headers. return true; } @@ -63,8 +63,8 @@ namespace SocketHttpListener.Net.WebSockets StringSplitOptions.RemoveEmptyEntries); acceptProtocol = subProtocol; - // client specified protocols, serverOptions has exactly 1 non-empty entry. Check that - // this exists in the list the client specified. + // client specified protocols, serverOptions has exactly 1 non-empty entry. Check that + // this exists in the list the client specified. for (int i = 0; i < requestProtocols.Length; i++) { string currentRequestProtocol = requestProtocols[i].Trim(); @@ -86,27 +86,27 @@ namespace SocketHttpListener.Net.WebSockets if (receiveBufferSize < MinReceiveBufferSize) { - throw new ArgumentOutOfRangeException("net_WebSockets_ArgumentOutOfRange_TooSmall"); + throw new ArgumentOutOfRangeException(nameof(receiveBufferSize), "The receiveBufferSize was too small."); } if (sendBufferSize < MinSendBufferSize) { - throw new ArgumentOutOfRangeException("net_WebSockets_ArgumentOutOfRange_TooSmall"); + throw new ArgumentOutOfRangeException(nameof(sendBufferSize), "The sendBufferSize was too small."); } if (receiveBufferSize > MaxBufferSize) { - throw new ArgumentOutOfRangeException("net_WebSockets_ArgumentOutOfRange_TooBig"); + throw new ArgumentOutOfRangeException(nameof(receiveBufferSize), "The receiveBufferSize was too large."); } if (sendBufferSize > MaxBufferSize) { - throw new ArgumentOutOfRangeException("net_WebSockets_ArgumentOutOfRange_TooBig"); + throw new ArgumentOutOfRangeException(nameof(sendBufferSize), "The sendBufferSize was too large."); } if (keepAliveInterval < Timeout.InfiniteTimeSpan) // -1 millisecond { - throw new ArgumentOutOfRangeException("net_WebSockets_ArgumentOutOfRange_TooSmall"); + throw new ArgumentOutOfRangeException(nameof(keepAliveInterval), "The keepAliveInterval was too small."); } } |
