C# 클래스 WebSocketSharp.Server.WebSocketBehavior

Exposes the methods and properties used to define the behavior of a WebSocket service provided by the WebSocketServer or HttpServer.
The WebSocketBehavior class is an abstract class.
상속: IWebSocketSession
파일 보기 프로젝트 열기: sta/websocket-sharp 1 사용 예제들

보호된 메소드들

메소드 설명
Error ( string message, Exception exception ) : void

Calls the OnError method with the specified message and exception.

This method doesn't call the OnError method if message is or empty.

OnClose ( CloseEventArgs e ) : void

Called when the WebSocket connection used in a session has been closed.

OnError ( ErrorEventArgs e ) : void

Called when the WebSocket used in a session gets an error.

OnMessage ( MessageEventArgs e ) : void

Called when the WebSocket used in a session receives a message.

OnOpen ( ) : void

Called when the WebSocket connection used in a session has been established.

Send ( FileInfo file ) : void

Sends the specified file as binary data to the client on a session.

This method is available after the WebSocket connection has been established.

Send ( byte data ) : void

Sends binary data to the client on a session.

This method is available after the WebSocket connection has been established.

Send ( string data ) : void

Sends text data to the client on a session.

This method is available after the WebSocket connection has been established.

SendAsync ( FileInfo file, Action completed ) : void

Sends the specified file as binary data asynchronously to the client on a session.

This method is available after the WebSocket connection has been established.

This method doesn't wait for the send to be complete.

SendAsync ( Stream stream, int length, Action completed ) : void

Sends binary data from the specified Stream asynchronously to the client on a session.

This method is available after the WebSocket connection has been established.

This method doesn't wait for the send to be complete.

SendAsync ( byte data, Action completed ) : void

Sends binary data asynchronously to the client on a session.

This method is available after the WebSocket connection has been established.

This method doesn't wait for the send to be complete.

SendAsync ( string data, Action completed ) : void

Sends text data asynchronously to the client on a session.

This method is available after the WebSocket connection has been established.

This method doesn't wait for the send to be complete.

WebSocketBehavior ( ) : System

Initializes a new instance of the WebSocketBehavior class.

비공개 메소드들

메소드 설명
Start ( WebSocketContext context, WebSocketSessionManager sessions ) : void
checkHandshakeRequest ( WebSocketContext context ) : string
onClose ( object sender, CloseEventArgs e ) : void
onError ( object sender, ErrorEventArgs e ) : void
onMessage ( object sender, MessageEventArgs e ) : void
onOpen ( object sender, EventArgs e ) : void

메소드 상세

Error() 보호된 메소드

Calls the OnError method with the specified message and exception.
This method doesn't call the OnError method if message is or empty.
protected Error ( string message, Exception exception ) : void
message string /// A that represents the error message. ///
exception System.Exception /// An instance that represents the cause of the error if any. ///
리턴 void

OnClose() 보호된 메소드

Called when the WebSocket connection used in a session has been closed.
protected OnClose ( CloseEventArgs e ) : void
e CloseEventArgs /// A that represents the event data passed to /// a event. ///
리턴 void

OnError() 보호된 메소드

Called when the WebSocket used in a session gets an error.
protected OnError ( ErrorEventArgs e ) : void
e System.IO.ErrorEventArgs /// A that represents the event data passed to /// a event. ///
리턴 void

OnMessage() 보호된 메소드

Called when the WebSocket used in a session receives a message.
protected OnMessage ( MessageEventArgs e ) : void
e MessageEventArgs /// A that represents the event data passed to /// a event. ///
리턴 void

OnOpen() 보호된 메소드

Called when the WebSocket connection used in a session has been established.
protected OnOpen ( ) : void
리턴 void

Send() 보호된 메소드

Sends the specified file as binary data to the client on a session.
This method is available after the WebSocket connection has been established.
protected Send ( FileInfo file ) : void
file System.IO.FileInfo /// A that represents the file to send. ///
리턴 void

Send() 보호된 메소드

Sends binary data to the client on a session.
This method is available after the WebSocket connection has been established.
protected Send ( byte data ) : void
data byte /// An array of that represents the binary data to send. ///
리턴 void

Send() 보호된 메소드

Sends text data to the client on a session.
This method is available after the WebSocket connection has been established.
protected Send ( string data ) : void
data string /// A that represents the text data to send. ///
리턴 void

SendAsync() 보호된 메소드

Sends the specified file as binary data asynchronously to the client on a session.

This method is available after the WebSocket connection has been established.

This method doesn't wait for the send to be complete.

protected SendAsync ( FileInfo file, Action completed ) : void
file System.IO.FileInfo /// A that represents the file to send. ///
completed Action /// An Action<bool> delegate that references the method(s) called when /// the send is complete. A passed to this delegate is true /// if the send is complete successfully. ///
리턴 void

SendAsync() 보호된 메소드

Sends binary data from the specified Stream asynchronously to the client on a session.

This method is available after the WebSocket connection has been established.

This method doesn't wait for the send to be complete.

protected SendAsync ( Stream stream, int length, Action completed ) : void
stream Stream /// A from which contains the binary data to send. ///
length int /// An that represents the number of bytes to send. ///
completed Action /// An Action<bool> delegate that references the method(s) called when /// the send is complete. A passed to this delegate is true /// if the send is complete successfully. ///
리턴 void

SendAsync() 보호된 메소드

Sends binary data asynchronously to the client on a session.

This method is available after the WebSocket connection has been established.

This method doesn't wait for the send to be complete.

protected SendAsync ( byte data, Action completed ) : void
data byte /// An array of that represents the binary data to send. ///
completed Action /// An Action<bool> delegate that references the method(s) called when /// the send is complete. A passed to this delegate is true /// if the send is complete successfully. ///
리턴 void

SendAsync() 보호된 메소드

Sends text data asynchronously to the client on a session.

This method is available after the WebSocket connection has been established.

This method doesn't wait for the send to be complete.

protected SendAsync ( string data, Action completed ) : void
data string /// A that represents the text data to send. ///
completed Action /// An Action<bool> delegate that references the method(s) called when /// the send is complete. A passed to this delegate is true /// if the send is complete successfully. ///
리턴 void

WebSocketBehavior() 보호된 메소드

Initializes a new instance of the WebSocketBehavior class.
protected WebSocketBehavior ( ) : System
리턴 System