From e2f3731516b284427cdffb96ed799e27ef4b7d56 Mon Sep 17 00:00:00 2001 From: sta Date: Thu, 8 Sep 2016 16:25:42 +0900 Subject: [PATCH] [Modify] Edit it --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4906affd..f7e68609 100644 --- a/README.md +++ b/README.md @@ -103,13 +103,19 @@ The `WebSocket` class exists in the `WebSocketSharp` namespace. Creating a new instance of the `WebSocket` class with the WebSocket URL to connect. +```csharp +var ws = new WebSocket ("ws://example.com"); +``` + +The `WebSocket` class inherits the `System.IDisposable` interface, so you can create it with the `using` statement. + ```csharp using (var ws = new WebSocket ("ws://example.com")) { ... } ``` -The `WebSocket` class inherits the `System.IDisposable` interface, so you can use the `using` statement. And the WebSocket connection will be closed with close status `1001` (going away) when the control leaves the `using` block. +This will **close** the WebSocket connection with status code `1001` (going away) when the control leaves the `using` block. #### Step 3 ####