Skip to content

Commit 3da0878

Browse files
committed
Create gh-pages branch via GitHub
1 parent 1f243df commit 3da0878

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

index.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,15 @@ <h4>
225225
<div class="highlight highlight-cs"><pre><span class="n">ws</span><span class="p">.</span><span class="n">Send</span> <span class="p">(</span><span class="n">data</span><span class="p">);</span>
226226
</pre></div>
227227

228-
<p>The <code>Send</code> method is overloaded.</p>
228+
<p>The <code>WebSocket.Send</code> method is overloaded.</p>
229229

230-
<p>The types of <code>data</code> are <code>string</code>, <code>byte []</code> and <code>System.IO.FileInfo</code> class.</p>
230+
<p>The types of <code>data</code> are <code>string</code>, <code>byte []</code> and <code>System.IO.FileInfo</code>.</p>
231231

232-
<p>In addition, the <code>Send (stream, length)</code> method exists, too.</p>
232+
<p>In addition, the <code>WebSocket.Send (stream, length)</code> method exists, too.</p>
233233

234234
<p>These methods don't wait for the send to be complete. This means that these methods behave asynchronously.</p>
235235

236-
<p>If you want to do something when the send is complete, you use any of some <code>Send (data, completed)</code> methods.</p>
236+
<p>If you do something when the send is complete, you use any of some <code>WebSocket.Send (data, completed)</code> methods.</p>
237237

238238
<h4>
239239
<a name="step-6" class="anchor" href="#step-6"><span class="octicon octicon-link"></span></a>Step 6</h4>
@@ -243,13 +243,13 @@ <h4>
243243
<div class="highlight highlight-cs"><pre><span class="n">ws</span><span class="p">.</span><span class="n">Close</span> <span class="p">(</span><span class="n">code</span><span class="p">,</span> <span class="n">reason</span><span class="p">);</span>
244244
</pre></div>
245245

246-
<p>If you want to close the WebSocket connection explicitly, you use the <code>Close</code> method.</p>
246+
<p>If you close the WebSocket connection explicitly, you use the <code>WebSocket.Close</code> method.</p>
247247

248-
<p>The <code>Close</code> method is overloaded.</p>
248+
<p>The <code>WebSocket.Close</code> method is overloaded.</p>
249249

250250
<p>The types of <code>code</code> are <code>WebSocketSharp.CloseStatusCode</code> and <code>ushort</code>, and the type of <code>reason</code> is <code>string</code>.</p>
251251

252-
<p>In addition, the <code>Close ()</code> and <code>Close (code)</code> methods exist, too.</p>
252+
<p>In addition, the <code>WebSocket.Close ()</code> and <code>WebSocket.Close (code)</code> methods exist, too.</p>
253253

254254
<h3>
255255
<a name="websocket-server" class="anchor" href="#websocket-server"><span class="octicon octicon-link"></span></a>WebSocket Server</h3>
@@ -301,7 +301,7 @@ <h4>
301301

302302
<p>Creating the class that inherits the <code>WebSocketService</code> class.</p>
303303

304-
<p>For example, if you want to provide an echo service,</p>
304+
<p>For example, if you provide an echo service,</p>
305305

306306
<div class="highlight highlight-cs"><pre><span class="k">using</span> <span class="nn">System</span><span class="p">;</span>
307307
<span class="k">using</span> <span class="nn">WebSocketSharp</span><span class="p">;</span>
@@ -316,7 +316,7 @@ <h4>
316316
<span class="p">}</span>
317317
</pre></div>
318318

319-
<p>And if you want to provide a chat service,</p>
319+
<p>And if you provide a chat service,</p>
320320

321321
<div class="highlight highlight-cs"><pre><span class="k">using</span> <span class="nn">System</span><span class="p">;</span>
322322
<span class="k">using</span> <span class="nn">WebSocketSharp</span><span class="p">;</span>
@@ -343,9 +343,9 @@ <h4>
343343
<span class="p">}</span>
344344
</pre></div>
345345

346-
<p>If you override the <code>OnMessage</code> method, it is bound to the server side <code>WebSocket.OnMessage</code> event.</p>
346+
<p>If you override the <code>WebSocketService.OnMessage</code> method, it's bound to the server side <code>WebSocket.OnMessage</code> event.</p>
347347

348-
<p>In addition, if you override the <code>OnOpen</code>, <code>OnError</code> and <code>OnClose</code> methods, each of them is bound to each server side event of <code>WebSocket.OnOpen</code>, <code>WebSocket.OnError</code> and <code>WebSocket.OnClose</code>.</p>
348+
<p>And if you override the <code>WebSocketService.OnOpen</code>, <code>WebSocketService.OnError</code> and <code>WebSocketService.OnClose</code> methods, each of them is bound to each server side event of <code>WebSocket.OnOpen</code>, <code>WebSocket.OnError</code> and <code>WebSocket.OnClose</code>.</p>
349349

350350
<p>The <code>WebSocketService.Send</code> method sends a data to the client of the current session to the WebSocket service.</p>
351351

@@ -396,7 +396,7 @@ <h4>
396396
<h3>
397397
<a name="http-server-with-the-websocket" class="anchor" href="#http-server-with-the-websocket"><span class="octicon octicon-link"></span></a>HTTP Server with the WebSocket</h3>
398398

399-
<p>I modified the <code>System.Net.HttpListener</code>, <code>System.Net.HttpListenerContext</code> and some other classes of <a href="http://www.mono-project.com">Mono</a> to create the HTTP server that can upgrade the connection to the WebSocket connection when receives a WebSocket connection request.</p>
399+
<p>I modified the <code>System.Net.HttpListener</code>, <code>System.Net.HttpListenerContext</code> and some other classes of <a href="http://www.mono-project.com">Mono</a> to create the HTTP server that can upgrade the connection to the WebSocket connection when it receives a WebSocket connection request.</p>
400400

401401
<p>You can add any WebSocket service with the specified path to the service to your <code>HttpServer</code> by using the <code>HttpServer.AddWebSocketService&lt;TWithNew&gt;</code> or <code>HttpServer.AddWebSocketService&lt;T&gt;</code> method.</p>
402402

@@ -439,7 +439,7 @@ <h3>
439439
<span class="p">}</span>
440440
</pre></div>
441441

442-
<p>If you want to set the custom validation for the server certificate, you use the <code>WebSocket.ServerCertificateValidationCallback</code> property.</p>
442+
<p>If you set the custom validation for the server certificate, you use the <code>WebSocket.ServerCertificateValidationCallback</code> property.</p>
443443

444444
<div class="highlight highlight-cs"><pre><span class="n">ws</span><span class="p">.</span><span class="n">ServerCertificateValidationCallback</span> <span class="p">=</span> <span class="p">(</span><span class="n">sender</span><span class="p">,</span> <span class="n">certificate</span><span class="p">,</span> <span class="n">chain</span><span class="p">,</span> <span class="n">sslPolicyErrors</span><span class="p">)</span> <span class="p">=&gt;</span>
445445
<span class="p">{</span>
@@ -463,14 +463,14 @@ <h3>
463463

464464
<p>The <code>WebSocket.Log</code> property provides the logging functions.</p>
465465

466-
<p>If you want to change the current logging level (the default is <code>LogLevel.ERROR</code>), you use the <code>WebSocket.Log.Level</code> property.</p>
466+
<p>If you change the current logging level (the default is <code>LogLevel.ERROR</code>), you use the <code>WebSocket.Log.Level</code> property.</p>
467467

468468
<div class="highlight highlight-cs"><pre><span class="n">ws</span><span class="p">.</span><span class="n">Log</span><span class="p">.</span><span class="n">Level</span> <span class="p">=</span> <span class="n">LogLevel</span><span class="p">.</span><span class="n">DEBUG</span><span class="p">;</span>
469469
</pre></div>
470470

471471
<p>The above means that the logging outputs with a less than <code>LogLevel.DEBUG</code> are not outputted.</p>
472472

473-
<p>And if you want to output a log, you use any of some output methods. The following outputs a log with <code>LogLevel.DEBUG</code>.</p>
473+
<p>And if you output a log, you use any of some output methods. The following outputs a log with <code>LogLevel.DEBUG</code>.</p>
474474

475475
<div class="highlight highlight-cs"><pre><span class="n">ws</span><span class="p">.</span><span class="n">Log</span><span class="p">.</span><span class="n">Debug</span> <span class="p">(</span><span class="s">"This is a debug message."</span><span class="p">);</span>
476476
</pre></div>

0 commit comments

Comments
 (0)