diff --git a/Example/Example.pidb b/Example/Example.pidb index ab3dc054..5f234714 100644 Binary files a/Example/Example.pidb and b/Example/Example.pidb differ diff --git a/Example/bin/Debug_Ubuntu/example.exe b/Example/bin/Debug_Ubuntu/example.exe index f0f743d9..7fdde136 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 b2fc8801..8ffc1471 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 0457d601..cf77c38d 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 dce1ca64..d02c12e6 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 8409cac2..81c7f7b6 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 bc6097c8..b6cf289e 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 0457d601..cf77c38d 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 dce1ca64..d02c12e6 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 1770447e..4fc955d6 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 eb6b86cf..c917e9f1 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 0457d601..cf77c38d 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 dce1ca64..d02c12e6 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 8961909a..33fa550f 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 008d364e..707e27e2 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 0457d601..cf77c38d 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 dce1ca64..d02c12e6 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/Ext.cs b/websocket-sharp/Ext.cs index d415789b..1508fd4b 100644 --- a/websocket-sharp/Ext.cs +++ b/websocket-sharp/Ext.cs @@ -1221,11 +1221,11 @@ namespace WebSocketSharp { /// public static bool TryCreateWebSocketUri(this string uriString, out Uri result, out string message) { - if (uriString == null) + if (uriString.IsNull()) throw new ArgumentNullException("uriString"); result = null; - if (uriString == String.Empty) + if (uriString.IsEmpty()) { message = "Must not be empty."; return false; @@ -1263,6 +1263,14 @@ namespace WebSocketSharp { return false; } } + else + { + port = scheme == "ws" + ? 80 + : 443; + var url = String.Format("{0}://{1}:{2}{3}", scheme, uri.Host, port, uri.PathAndQuery); + uri = url.ToUri(); + } result = uri; message = String.Empty; diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index 45b09897..c6e8278f 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -65,18 +65,18 @@ namespace WebSocketSharp { #region Private Fields private string _base64key; + private bool _client; private Action _closeContext; private WebSocketContext _context; private string _extensions; private AutoResetEvent _exitMessageLoop; private Object _forClose; private Object _forSend; - private bool _isClient; - private bool _isSecure; private string _protocol; private string _protocols; private volatile WsState _readyState; private AutoResetEvent _receivePong; + private bool _secure; private TcpClient _tcpClient; private Uri _uri; private WsStream _wsStream; @@ -119,10 +119,13 @@ namespace WebSocketSharp { #region Public Constructors /// - /// Initializes a new instance of the class with the specified WebSocket URL and subprotocols. + /// Initializes a new instance of the class with the specified WebSocket URL and subprotocols. /// + /// + /// + /// /// - /// A that contains the WebSocket URL. + /// A that contains a WebSocket URL. /// /// /// An array of that contains the WebSocket subprotocols if any. @@ -141,33 +144,40 @@ namespace WebSocketSharp { Uri uri; string msg; - if (!tryCreateUri(url, out uri, out msg)) + if (!url.TryCreateWebSocketUri(out uri, out msg)) throw new ArgumentException(msg, "url"); _uri = uri; _protocols = protocols.ToString(", "); _base64key = createBase64Key(); - _isClient = true; - _isSecure = uri.Scheme == "wss" ? true : false; + _client = true; + _secure = uri.Scheme == "wss" + ? true + : false; } /// - /// Initializes a new instance of the class with the specified WebSocket URL, OnOpen, OnMessage, OnError, OnClose event handlers and subprotocols. + /// Initializes a new instance of the class with the specified WebSocket URL, + /// OnOpen, OnMessage, OnError, OnClose event handlers and subprotocols. /// + /// + /// This constructor initializes a new instance of the class and + /// establishes a WebSocket connection. + /// /// - /// A that contains the WebSocket URL. + /// A that contains a WebSocket URL. /// /// - /// An OnOpen event handler. + /// An event handler. /// /// - /// An OnMessage event handler. + /// An event handler. /// /// - /// An OnError event handler. + /// An event handler. /// /// - /// An OnClose event handler. + /// An event handler. /// /// /// An array of that contains the WebSocket subprotocols if any. @@ -234,7 +244,7 @@ namespace WebSocketSharp { /// public bool IsSecure { get { - return _isSecure; + return _secure; } } @@ -274,7 +284,7 @@ namespace WebSocketSharp { } internal set { - if (_readyState == WsState.CONNECTING && !_isClient) + if (_readyState == WsState.CONNECTING && !_client) _uri = value; } } @@ -284,17 +294,17 @@ namespace WebSocketSharp { #region Events /// - /// Occurs when the WebSocket receives a Close frame or the Close method is called. + /// Occurs when the receives a Close frame or the Close method is called. /// public event EventHandler OnClose; /// - /// Occurs when the WebSocket gets an error. + /// Occurs when the gets an error. /// public event EventHandler OnError; /// - /// Occurs when the WebSocket receives a data frame. + /// Occurs when the receives a data frame. /// public event EventHandler OnMessage; @@ -333,7 +343,7 @@ namespace WebSocketSharp { private void close(HttpStatusCode code) { - if (_readyState != WsState.CONNECTING || _isClient) + if (_readyState != WsState.CONNECTING || _client) return; sendResponseHandshake(code); @@ -353,7 +363,7 @@ namespace WebSocketSharp { return; // Whether the closing handshake as server is started before the connection has been established ? - if (_readyState == WsState.CONNECTING && !_isClient) + if (_readyState == WsState.CONNECTING && !_client) { sendResponseHandshake(HttpStatusCode.BadRequest); onClose(new CloseEventArgs(data)); @@ -418,7 +428,7 @@ namespace WebSocketSharp { try { - if (_isClient) + if (_client) closeResourcesAsClient(); else closeResourcesAsServer(); @@ -461,7 +471,7 @@ namespace WebSocketSharp { private bool connect() { - return _isClient + return _client ? doHandshake() : acceptHandshake(); } @@ -476,23 +486,9 @@ namespace WebSocketSharp { return Convert.ToBase64String(src); } - // As Client - private void createClientStream() - { - var host = _uri.DnsSafeHost; - var port = _uri.Port > 0 - ? _uri.Port - : _isSecure - ? 443 - : 80; - - _tcpClient = new TcpClient(host, port); - _wsStream = WsStream.CreateClientStream(_tcpClient, host, _isSecure); - } - private WsFrame createFrame(Fin fin, Opcode opcode, PayloadData payloadData) { - return _isClient + return _client ? new WsFrame(fin, opcode, payloadData) : new WsFrame(fin, opcode, Mask.UNMASK, payloadData); } @@ -501,10 +497,9 @@ namespace WebSocketSharp { private RequestHandshake createOpeningHandshake() { var path = _uri.PathAndQuery; - var host = _uri.DnsSafeHost; - var port = ((System.Net.IPEndPoint)_tcpClient.Client.RemoteEndPoint).Port; - if (port != 80) - host += ":" + port; + var host = _uri.Port == 80 + ? _uri.DnsSafeHost + : _uri.Authority; var req = new RequestHandshake(path); req.AddHeader("Host", host); @@ -547,17 +542,17 @@ namespace WebSocketSharp { // As Client private bool doHandshake() { - createClientStream(); - return sendOpeningHandshake(); + sendOpeningHandshake(); + return receiveResponseHandshake(); } // As Server private void init(WebSocketContext context) { - _context = context; - _uri = context.Path.ToUri(); - _isSecure = context.IsSecureConnection; - _isClient = false; + _context = context; + _uri = context.Path.ToUri(); + _secure = context.IsSecureConnection; + _client = false; } private bool isValidCloseStatusCode(ushort code, out string message) @@ -848,14 +843,28 @@ namespace WebSocketSharp { } // As Client - private ResponseHandshake receiveResponseHandshake() + private bool receiveResponseHandshake() { var res = ResponseHandshake.Parse(readHandshake()); #if DEBUG Console.WriteLine("WS: Info@receiveResponseHandshake: Response handshake from server:\n"); Console.WriteLine(res.ToString()); #endif - return res; + if (!isValidResponse(res)) + { + var msg = "Invalid response to the WebSocket connection request."; + onError(msg); + close(CloseStatusCode.ABNORMAL, msg); + return false; + } + + if (res.HeaderExists("Sec-WebSocket-Protocol")) + _protocol = res.Headers["Sec-WebSocket-Protocol"]; + + if (res.HeaderExists("Sec-WebSocket-Extensions")) + _extensions = res.Headers["Sec-WebSocket-Extensions"]; + + return true; } private bool send(WsFrame frame) @@ -990,27 +999,11 @@ namespace WebSocketSharp { } // As Client - private bool sendOpeningHandshake() + private void sendOpeningHandshake() { + setClientStream(); var req = createOpeningHandshake(); sendRequestHandshake(req); - - var res = receiveResponseHandshake(); - if (!isValidResponse(res)) - { - var msg = "Invalid response to the WebSocket connection request."; - onError(msg); - close(CloseStatusCode.ABNORMAL, msg); - return false; - } - - if (res.HeaderExists("Sec-WebSocket-Protocol")) - _protocol = res.Headers["Sec-WebSocket-Protocol"]; - - if (res.HeaderExists("Sec-WebSocket-Extensions")) - _extensions = res.Headers["Sec-WebSocket-Extensions"]; - - return true; } // As Client @@ -1047,6 +1040,15 @@ namespace WebSocketSharp { writeHandshake(response); } + // As Client + private void setClientStream() + { + var host = _uri.DnsSafeHost; + var port = _uri.Port; + _tcpClient = new TcpClient(host, port); + _wsStream = WsStream.CreateClientStream(_tcpClient, host, _secure); + } + private void startMessageLoop() { _exitMessageLoop = new AutoResetEvent(false); @@ -1076,11 +1078,6 @@ namespace WebSocketSharp { _wsStream.ReadFrameAsync(completed); } - private bool tryCreateUri(string uriString, out Uri result, out string message) - { - return uriString.TryCreateWebSocketUri(out result, out message); - } - private void writeHandshake(Handshake handshake) { _wsStream.WriteHandshake(handshake); @@ -1101,7 +1098,7 @@ namespace WebSocketSharp { #region Public Methods /// - /// Closes the connection and releases all associated resources after sends a Close control frame. + /// Closes the WebSocket connection and releases all associated resources. /// public void Close() { @@ -1110,21 +1107,11 @@ namespace WebSocketSharp { } /// - /// Closes the connection and releases all associated resources after sends a Close control frame. + /// Closes the WebSocket connection with the specified + /// and releases all associated resources. /// /// - /// A that contains a status code indicating a reason for closure. - /// - public void Close(CloseStatusCode code) - { - Close(code, String.Empty); - } - - /// - /// Closes the connection and releases all associated resources after sends a Close control frame. - /// - /// - /// A that contains a status code indicating a reason for closure. + /// A that contains a status code indicating the reason for closure. /// public void Close(ushort code) { @@ -1132,27 +1119,27 @@ namespace WebSocketSharp { } /// - /// Closes the connection and releases all associated resources after sends a Close control frame. + /// Closes the WebSocket connection with the specified + /// and releases all associated resources. /// /// - /// A that contains a status code indicating a reason for closure. + /// One of the values that contains a status code + /// indicating the reason for closure. /// - /// - /// A that contains a reason for closure. - /// - public void Close(CloseStatusCode code, string reason) + public void Close(CloseStatusCode code) { - Close((ushort)code, reason); + Close(code, String.Empty); } /// - /// Closes the connection and releases all associated resources after sends a Close control frame. + /// Closes the WebSocket connection with the specified and , + /// and releases all associated resources. /// /// - /// A that contains a status code indicating a reason for closure. + /// A that contains a status code indicating the reason for closure. /// /// - /// A that contains a reason for closure. + /// A that contains the reason for closure. /// public void Close(ushort code, string reason) { @@ -1166,6 +1153,22 @@ namespace WebSocketSharp { close(code, reason); } + /// + /// Closes the WebSocket connection with the specified and , + /// and releases all associated resources. + /// + /// + /// One of the values that contains a status code + /// indicating the reason for closure. + /// + /// + /// A that contains the reason for closure. + /// + public void Close(CloseStatusCode code, string reason) + { + Close((ushort)code, reason); + } + /// /// Establishes a WebSocket connection. /// @@ -1191,13 +1194,10 @@ namespace WebSocketSharp { } /// - /// Closes the connection and releases all associated resources after sends a Close control frame. + /// Closes the WebSocket connection and releases all associated resources. /// /// - /// Call when you are finished using the . The - /// method leaves the in an unusable state. After - /// calling , you must release all references to the so - /// the garbage collector can reclaim the memory that the was occupying. + /// This method closes the WebSocket connection with the . /// public void Dispose() { @@ -1205,10 +1205,10 @@ namespace WebSocketSharp { } /// - /// Sends a Ping frame using the connection. + /// Pings using the WebSocket connection. /// /// - /// true if the WebSocket receives a Pong frame in a time; otherwise, false. + /// true if the receives a Pong in a time; otherwise, false. /// public bool Ping() { @@ -1216,26 +1216,26 @@ namespace WebSocketSharp { } /// - /// Sends a Ping frame with a message using the connection. + /// Pings with the specified using the WebSocket connection. /// /// - /// A that contains the message to be sent. + /// A that contains a message. /// /// - /// true if the WebSocket receives a Pong frame in a time; otherwise, false. + /// true if the receives a Pong in a time; otherwise, false. /// public bool Ping(string message) { if (message.IsNull()) message = String.Empty; - return _isClient + return _client ? ping(message, 5 * 1000) : ping(message, 1 * 1000); } /// - /// Sends a binary data using the connection. + /// Sends a binary using the WebSocket connection. /// /// /// An array of that contains a binary data to send. @@ -1252,7 +1252,7 @@ namespace WebSocketSharp { } /// - /// Sends a text data using the connection. + /// Sends a text using the WebSocket connection. /// /// /// A that contains a text data to send. @@ -1270,7 +1270,7 @@ namespace WebSocketSharp { } /// - /// Sends a binary data using the connection. + /// Sends a binary data using the WebSocket connection. /// /// /// A that contains a binary data to send. @@ -1290,13 +1290,14 @@ namespace WebSocketSharp { } /// - /// Sends a binary data asynchronously using the connection. + /// Sends a binary asynchronously using the WebSocket connection. /// /// /// An array of that contains a binary data to send. /// /// - /// An delegate that contains the method(s) that is called when an asynchronous operation completes. + /// An delegate that references the method(s) called when + /// the asynchronous operation completes. /// public void SendAsync(byte[] data, Action completed) { @@ -1310,13 +1311,14 @@ namespace WebSocketSharp { } /// - /// Sends a text data asynchronously using the connection. + /// Sends a text asynchronously using the WebSocket connection. /// /// /// A that contains a text data to send. /// /// - /// An delegate that contains the method(s) that is called when an asynchronous operation completes. + /// An delegate that references the method(s) called when + /// the asynchronous operation completes. /// public void SendAsync(string data, Action completed) { @@ -1331,13 +1333,14 @@ namespace WebSocketSharp { } /// - /// Sends a binary data asynchronously using the connection. + /// Sends a binary data asynchronously using the WebSocket connection. /// /// /// A that contains a binary data to send. /// /// - /// An delegate that contains the method(s) that is called when an asynchronous operation completes. + /// An delegate that references the method(s) called when + /// the asynchronous operation completes. /// public void SendAsync(FileInfo file, Action completed) { diff --git a/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll b/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll index 0457d601..cf77c38d 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 dce1ca64..d02c12e6 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 f244c4dc..d744837e 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 b66a59de..302248e0 100644 --- a/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.xml +++ b/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.xml @@ -811,8 +811,10 @@ Initializes a new instance of the class with the specified WebSocket URL and subprotocols. + + - A that contains the WebSocket URL. + A that contains a WebSocket URL. An array of that contains the WebSocket subprotocols if any. @@ -826,22 +828,27 @@ - Initializes a new instance of the class with the specified WebSocket URL, OnOpen, OnMessage, OnError, OnClose event handlers and subprotocols. + Initializes a new instance of the class with the specified WebSocket URL, + OnOpen, OnMessage, OnError, OnClose event handlers and subprotocols. + + This constructor initializes a new instance of the class and + establishes a WebSocket connection. + - A that contains the WebSocket URL. + A that contains a WebSocket URL. - An OnOpen event handler. + An event handler. - An OnMessage event handler. + An event handler. - An OnError event handler. + An event handler. - An OnClose event handler. + An event handler. An array of that contains the WebSocket subprotocols if any. @@ -855,17 +862,17 @@ - Occurs when the WebSocket receives a Close frame or the Close method is called. + Occurs when the receives a Close frame or the Close method is called. - Occurs when the WebSocket gets an error. + Occurs when the gets an error. - Occurs when the WebSocket receives a data frame. + Occurs when the receives a data frame. @@ -923,45 +930,51 @@ - Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection and releases all associated resources. - + - Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified + and releases all associated resources. - A that contains a status code indicating a reason for closure. + A that contains a status code indicating the reason for closure. - + - Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified + and releases all associated resources. - A that contains a status code indicating a reason for closure. + One of the values that contains a status code + indicating the reason for closure. - + - Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified and , + and releases all associated resources. - A that contains a status code indicating a reason for closure. + A that contains a status code indicating the reason for closure. - A that contains a reason for closure. + A that contains the reason for closure. - + - Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified and , + and releases all associated resources. - A that contains a status code indicating a reason for closure. + One of the values that contains a status code + indicating the reason for closure. - A that contains a reason for closure. + A that contains the reason for closure. @@ -971,37 +984,34 @@ - Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection and releases all associated resources. - Call when you are finished using the . The - method leaves the in an unusable state. After - calling , you must release all references to the so - the garbage collector can reclaim the memory that the was occupying. + This method closes the WebSocket connection with the . - Sends a Ping frame using the connection. + Pings using the WebSocket connection. - true if the WebSocket receives a Pong frame in a time; otherwise, false. + true if the receives a Pong in a time; otherwise, false. - Sends a Ping frame with a message using the connection. + Pings with the specified using the WebSocket connection. - A that contains the message to be sent. + A that contains a message. - true if the WebSocket receives a Pong frame in a time; otherwise, false. + true if the receives a Pong in a time; otherwise, false. - Sends a binary data using the connection. + Sends a binary using the WebSocket connection. An array of that contains a binary data to send. @@ -1009,7 +1019,7 @@ - Sends a text data using the connection. + Sends a text using the WebSocket connection. A that contains a text data to send. @@ -1017,7 +1027,7 @@ - Sends a binary data using the connection. + Sends a binary data using the WebSocket connection. A that contains a binary data to send. @@ -1025,35 +1035,38 @@ - Sends a binary data asynchronously using the connection. + Sends a binary asynchronously using the WebSocket connection. An array of that contains a binary data to send. - An delegate that contains the method(s) that is called when an asynchronous operation completes. + An delegate that references the method(s) called when + the asynchronous operation completes. - Sends a text data asynchronously using the connection. + Sends a text asynchronously using the WebSocket connection. A that contains a text data to send. - An delegate that contains the method(s) that is called when an asynchronous operation completes. + An delegate that references the method(s) called when + the asynchronous operation completes. - Sends a binary data asynchronously using the connection. + Sends a binary data asynchronously using the WebSocket connection. A that contains a binary data to send. - An delegate that contains the method(s) that is called when an asynchronous operation completes. + An delegate that references the method(s) called when + the asynchronous operation completes. diff --git a/websocket-sharp/doc/html/WebSocketSharp/WebSocket.html b/websocket-sharp/doc/html/WebSocketSharp/WebSocket.html index b45af432..115ac599 100644 --- a/websocket-sharp/doc/html/WebSocketSharp/WebSocket.html +++ b/websocket-sharp/doc/html/WebSocketSharp/WebSocket.html @@ -258,7 +258,8 @@ (string, EventHandler, EventHandler<MessageEventArgs>, EventHandler<ErrorEventArgs>, EventHandler<CloseEventArgs>, params string[]) - Initializes a new instance of the WebSocketSharp.WebSocket class with the specified WebSocket URL, OnOpen, OnMessage, OnError, OnClose event handlers and subprotocols. + Initializes a new instance of the WebSocketSharp.WebSocket class with the specified WebSocket URL, + OnOpen, OnMessage, OnError, OnClose event handlers and subprotocols. @@ -368,7 +369,7 @@ Close ()
- Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection and releases all associated resources.
@@ -380,7 +381,8 @@ Close (ushort)
- Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified code + and releases all associated resources.
@@ -392,7 +394,8 @@ Close (CloseStatusCode)
- Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified code + and releases all associated resources.
@@ -404,7 +407,8 @@ Close (ushort, string)
- Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified code and reason, + and releases all associated resources.
@@ -416,7 +420,8 @@ Close (CloseStatusCode, string)
- Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified code and reason, + and releases all associated resources.
@@ -440,7 +445,7 @@ Dispose ()
- Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection and releases all associated resources.
@@ -452,7 +457,7 @@ Ping () : bool
- Sends a Ping frame using the connection. + Pings using the WebSocket connection.
@@ -464,7 +469,7 @@ Ping (string) : bool
- Sends a Ping frame with a message using the connection. + Pings with the specified message using the WebSocket connection.
@@ -476,7 +481,7 @@ Send (byte[])
- Sends a binary data using the connection. + Sends a binary data using the WebSocket connection.
@@ -488,7 +493,7 @@ Send (System.IO.FileInfo)
- Sends a binary data using the connection. + Sends a binary data using the WebSocket connection.
@@ -500,7 +505,7 @@ Send (string)
- Sends a text data using the connection. + Sends a text data using the WebSocket connection.
@@ -512,7 +517,7 @@ SendAsync (byte[], Action)
- Sends a binary data asynchronously using the connection. + Sends a binary data asynchronously using the WebSocket connection.
@@ -524,7 +529,7 @@ SendAsync (System.IO.FileInfo, Action)
- Sends a binary data asynchronously using the connection. + Sends a binary data asynchronously using the WebSocket connection.
@@ -536,7 +541,7 @@ SendAsync (string, Action)
- Sends a text data asynchronously using the connection. + Sends a text data asynchronously using the WebSocket connection.
@@ -557,7 +562,7 @@ - Occurs when the WebSocket receives a Close frame or the Close method is called. + Occurs when the WebSocketSharp.WebSocket receives a Close frame or the Close method is called. @@ -571,7 +576,7 @@ - Occurs when the WebSocket gets an error. + Occurs when the WebSocketSharp.WebSocket gets an error. @@ -585,7 +590,7 @@ - Occurs when the WebSocket receives a data frame. + Occurs when the WebSocketSharp.WebSocket receives a data frame. @@ -654,7 +659,7 @@ url
- A string that contains the WebSocket URL. + A string that contains a WebSocket URL.
protocols @@ -691,7 +696,6 @@

Remarks

- Documentation for this section has not yet been entered.

Requirements

@@ -701,7 +705,8 @@

WebSocket Constructor

- Initializes a new instance of the WebSocketSharp.WebSocket class with the specified WebSocket URL, OnOpen, OnMessage, OnError, OnClose event handlers and subprotocols. + Initializes a new instance of the WebSocketSharp.WebSocket class with the specified WebSocket URL, + OnOpen, OnMessage, OnError, OnClose event handlers and subprotocols.

Syntax

public WebSocket (string url, EventHandler onOpen, EventHandler<MessageEventArgs> onMessage, EventHandler<ErrorEventArgs> onError, EventHandler<CloseEventArgs> onClose, params string[] protocols)
@@ -712,31 +717,31 @@ url
- A string that contains the WebSocket URL. + A string that contains a WebSocket URL.
onOpen
- An OnOpen event handler. + An WebSocket.OnOpen event handler.
onMessage
- An OnMessage event handler. + An WebSocket.OnMessage event handler.
onError
- An OnError event handler. + An WebSocket.OnError event handler.
onClose
- An OnClose event handler. + An WebSocket.OnClose event handler.
protocols @@ -773,8 +778,9 @@

Remarks

- Documentation for this section has not yet been entered. -
+ This constructor initializes a new instance of the WebSocketSharp.WebSocket class and + establishes a WebSocket connection. +

Requirements

Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
@@ -783,7 +789,7 @@

Close Method

- Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection and releases all associated resources.

Syntax

public void Close ()
@@ -799,7 +805,8 @@

Close Method

- Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified code + and releases all associated resources.

Syntax

public void Close (ushort code)
@@ -810,7 +817,7 @@ code
- A ushort that contains a status code indicating a reason for closure. + A ushort that contains a status code indicating the reason for closure.
@@ -826,7 +833,8 @@

Close Method

- Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified code + and releases all associated resources.

Syntax

public void Close (CloseStatusCode code)
@@ -837,7 +845,8 @@ code
- A WebSocketSharp.CloseStatusCode that contains a status code indicating a reason for closure. + One of the WebSocketSharp.CloseStatusCode values that contains a status code + indicating the reason for closure.
@@ -853,7 +862,8 @@

Close Method

- Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified code and reason, + and releases all associated resources.

Syntax

public void Close (ushort code, string reason)
@@ -864,13 +874,13 @@ code
- A ushort that contains a status code indicating a reason for closure. + A ushort that contains a status code indicating the reason for closure.
reason
- A string that contains a reason for closure. + A string that contains the reason for closure.
@@ -886,7 +896,8 @@

Close Method

- Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified code and reason, + and releases all associated resources.

Syntax

public void Close (CloseStatusCode code, string reason)
@@ -897,13 +908,14 @@ code
- A WebSocketSharp.CloseStatusCode that contains a status code indicating a reason for closure. + One of the WebSocketSharp.CloseStatusCode values that contains a status code + indicating the reason for closure.
reason
- A string that contains a reason for closure. + A string that contains the reason for closure.
@@ -935,16 +947,13 @@

Dispose Method

- Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection and releases all associated resources.

Syntax

public void Dispose ()

Remarks

- Call WebSocket.Dispose when you are finished using the WebSocketSharp.WebSocket. The - WebSocket.Dispose method leaves the WebSocketSharp.WebSocket in an unusable state. After - calling WebSocket.Dispose, you must release all references to the WebSocketSharp.WebSocket so - the garbage collector can reclaim the memory that the WebSocketSharp.WebSocket was occupying. + This method closes the WebSocket connection with the CloseStatusCode.AWAY.

Requirements

@@ -1014,7 +1023,7 @@

OnClose Event

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

Syntax

public event EventHandler<CloseEventArgs> OnClose
@@ -1030,7 +1039,7 @@

OnError Event

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

Syntax

public event EventHandler<ErrorEventArgs> OnError
@@ -1046,7 +1055,7 @@

OnMessage Event

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

Syntax

public event EventHandler<MessageEventArgs> OnMessage
@@ -1078,13 +1087,13 @@

Ping Method

- Sends a Ping frame using the connection. + Pings using the WebSocket connection.

Syntax

public bool Ping ()

Returns

- true if the WebSocket receives a Pong frame in a time; otherwise, false. + true if the WebSocketSharp.WebSocket receives a Pong in a time; otherwise, false.

Remarks

@@ -1098,7 +1107,7 @@

Ping Method

- Sends a Ping frame with a message using the connection. + Pings with the specified message using the WebSocket connection.

Syntax

public bool Ping (string message)
@@ -1109,13 +1118,13 @@ message
- A string that contains the message to be sent. + A string that contains a message.

Returns

- true if the WebSocket receives a Pong frame in a time; otherwise, false. + true if the WebSocketSharp.WebSocket receives a Pong in a time; otherwise, false.

Remarks

@@ -1169,7 +1178,7 @@

Send Method

- Sends a binary data using the connection. + Sends a binary data using the WebSocket connection.

Syntax

public void Send (byte[] data)
@@ -1196,7 +1205,7 @@

Send Method

- Sends a binary data using the connection. + Sends a binary data using the WebSocket connection.

Syntax

public void Send (System.IO.FileInfo file)
@@ -1223,7 +1232,7 @@

Send Method

- Sends a text data using the connection. + Sends a text data using the WebSocket connection.

Syntax

public void Send (string data)
@@ -1250,7 +1259,7 @@

SendAsync Method

- Sends a binary data asynchronously using the connection. + Sends a binary data asynchronously using the WebSocket connection.

Syntax

public void SendAsync (byte[] data, Action completed)
@@ -1267,7 +1276,8 @@ completed
- An Action delegate that contains the method(s) that is called when an asynchronous operation completes. + An Action delegate that references the method(s) called when + the asynchronous operation completes.
@@ -1283,7 +1293,7 @@

SendAsync Method

- Sends a binary data asynchronously using the connection. + Sends a binary data asynchronously using the WebSocket connection.

Syntax

public void SendAsync (System.IO.FileInfo file, Action completed)
@@ -1300,7 +1310,8 @@ completed
- An Action delegate that contains the method(s) that is called when an asynchronous operation completes. + An Action delegate that references the method(s) called when + the asynchronous operation completes.
@@ -1316,7 +1327,7 @@

SendAsync Method

- Sends a text data asynchronously using the connection. + Sends a text data asynchronously using the WebSocket connection.

Syntax

public void SendAsync (string data, Action completed)
@@ -1333,7 +1344,8 @@ completed
- An Action delegate that contains the method(s) that is called when an asynchronous operation completes. + An Action delegate that references the method(s) called when + the asynchronous operation completes.
diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp/WebSocket.xml b/websocket-sharp/doc/mdoc/WebSocketSharp/WebSocket.xml index a701848f..b4033c83 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp/WebSocket.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp/WebSocket.xml @@ -37,7 +37,7 @@ - A that contains the WebSocket URL. + A that contains a WebSocket URL. An array of that contains the WebSocket subprotocols if any. @@ -45,7 +45,7 @@ Initializes a new instance of the class with the specified WebSocket URL and subprotocols. - To be added. + is . @@ -74,27 +74,31 @@ - A that contains the WebSocket URL. + A that contains a WebSocket URL. - An OnOpen event handler. + An event handler. - An OnMessage event handler. + An event handler. - An OnError event handler. + An event handler. - An OnClose event handler. + An event handler. An array of that contains the WebSocket subprotocols if any. - Initializes a new instance of the class with the specified WebSocket URL, OnOpen, OnMessage, OnError, OnClose event handlers and subprotocols. + Initializes a new instance of the class with the specified WebSocket URL, + OnOpen, OnMessage, OnError, OnClose event handlers and subprotocols. - To be added. + + This constructor initializes a new instance of the class and + establishes a WebSocket connection. + is . @@ -113,7 +117,7 @@ - Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection and releases all associated resources. To be added. @@ -130,10 +134,11 @@ - A that contains a status code indicating a reason for closure. + A that contains a status code indicating the reason for closure. - Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified + and releases all associated resources. To be added. @@ -150,10 +155,12 @@ - A that contains a status code indicating a reason for closure. + One of the values that contains a status code + indicating the reason for closure. - Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified + and releases all associated resources. To be added. @@ -171,13 +178,14 @@ - A that contains a status code indicating a reason for closure. + A that contains a status code indicating the reason for closure. - A that contains a reason for closure. + A that contains the reason for closure. - Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified and , + and releases all associated resources. To be added. @@ -195,13 +203,15 @@ - A that contains a status code indicating a reason for closure. + One of the values that contains a status code + indicating the reason for closure. - A that contains a reason for closure. + A that contains the reason for closure. - Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection with the specified and , + and releases all associated resources. To be added. @@ -231,13 +241,10 @@ - Closes the connection and releases all associated resources after sends a Close control frame. + Closes the WebSocket connection and releases all associated resources. - Call when you are finished using the . The - method leaves the in an unusable state. After - calling , you must release all references to the so - the garbage collector can reclaim the memory that the was occupying. + This method closes the WebSocket connection with the . @@ -301,7 +308,7 @@ - Occurs when the WebSocket receives a Close frame or the Close method is called. + Occurs when the receives a Close frame or the Close method is called. To be added. @@ -315,7 +322,7 @@ - Occurs when the WebSocket gets an error. + Occurs when the gets an error. To be added. @@ -329,7 +336,7 @@ - Occurs when the WebSocket receives a data frame. + Occurs when the receives a data frame. To be added. @@ -358,10 +365,10 @@ - Sends a Ping frame using the connection. + Pings using the WebSocket connection. - true if the WebSocket receives a Pong frame in a time; otherwise, false. + true if the receives a Pong in a time; otherwise, false. To be added. @@ -378,13 +385,13 @@ - A that contains the message to be sent. + A that contains a message. - Sends a Ping frame with a message using the connection. + Pings with the specified using the WebSocket connection. - true if the WebSocket receives a Pong frame in a time; otherwise, false. + true if the receives a Pong in a time; otherwise, false. To be added. @@ -438,7 +445,7 @@ An array of that contains a binary data to send. - Sends a binary data using the connection. + Sends a binary using the WebSocket connection. To be added. @@ -458,7 +465,7 @@ A that contains a binary data to send. - Sends a binary data using the connection. + Sends a binary data using the WebSocket connection. To be added. @@ -478,7 +485,7 @@ A that contains a text data to send. - Sends a text data using the connection. + Sends a text using the WebSocket connection. To be added. @@ -499,10 +506,11 @@ An array of that contains a binary data to send. - An delegate that contains the method(s) that is called when an asynchronous operation completes. + An delegate that references the method(s) called when + the asynchronous operation completes. - Sends a binary data asynchronously using the connection. + Sends a binary asynchronously using the WebSocket connection. To be added. @@ -523,10 +531,11 @@ A that contains a binary data to send. - An delegate that contains the method(s) that is called when an asynchronous operation completes. + An delegate that references the method(s) called when + the asynchronous operation completes. - Sends a binary data asynchronously using the connection. + Sends a binary data asynchronously using the WebSocket connection. To be added. @@ -547,10 +556,11 @@ A that contains a text data to send. - An delegate that contains the method(s) that is called when an asynchronous operation completes. + An delegate that references the method(s) called when + the asynchronous operation completes. - Sends a text data asynchronously using the connection. + Sends a text asynchronously using the WebSocket connection. To be added. diff --git a/websocket-sharp/doc/mdoc/index.xml b/websocket-sharp/doc/mdoc/index.xml index 560a6979..59088694 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 ] diff --git a/websocket-sharp/websocket-sharp.pidb b/websocket-sharp/websocket-sharp.pidb index 784628e3..d0f003d7 100644 Binary files a/websocket-sharp/websocket-sharp.pidb and b/websocket-sharp/websocket-sharp.pidb differ