You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<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>
247
247
248
-
<p>The <code>Close</code> method is overloaded.</p>
248
+
<p>The <code>WebSocket.Close</code> method is overloaded.</p>
249
249
250
250
<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>
251
251
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>
<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>
347
347
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>
349
349
350
350
<p>The <code>WebSocketService.Send</code> method sends a data to the client of the current session to the WebSocket service.</p>
351
351
@@ -396,7 +396,7 @@ <h4>
396
396
<h3>
397
397
<aname="http-server-with-the-websocket" class="anchor" href="#http-server-with-the-websocket"><spanclass="octicon octicon-link"></span></a>HTTP Server with the WebSocket</h3>
398
398
399
-
<p>I modified the <code>System.Net.HttpListener</code>, <code>System.Net.HttpListenerContext</code> and some other classes of <ahref="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 <ahref="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>
400
400
401
401
<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<TWithNew></code> or <code>HttpServer.AddWebSocketService<T></code> method.</p>
402
402
@@ -439,7 +439,7 @@ <h3>
439
439
<spanclass="p">}</span>
440
440
</pre></div>
441
441
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>
<p>The <code>WebSocket.Log</code> property provides the logging functions.</p>
465
465
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>
<p>The above means that the logging outputs with a less than <code>LogLevel.DEBUG</code> are not outputted.</p>
472
472
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>
474
474
475
475
<divclass="highlight highlight-cs"><pre><spanclass="n">ws</span><spanclass="p">.</span><spanclass="n">Log</span><spanclass="p">.</span><spanclass="n">Debug</span><spanclass="p">(</span><spanclass="s">"This is a debug message."</span><spanclass="p">);</span>
0 commit comments