C# 클래스 NetMud.Websock.Descriptor

Main handler of descriptor connections for websockets
상속: NetMud.Websock.Channel, IDescriptor
파일 보기 프로젝트 열기: SwiftAusterity/NetMud

Private Properties

프로퍼티 타입 설명
DataAvailable Task
DecodeSocket string
EncodeSocket Byte[]
GetUserIDFromCookie void
OnClose void
OnError void
OnMessage bool
OnOpen void
Send void
SendPing void
StartLoop void
ValidateUser void
WriteData void

공개 메소드들

메소드 설명
Descriptor ( TcpClient tcpClient ) : Microsoft.AspNet.Identity

Creates an instance of the command negotiator

Descriptor ( TcpClient tcpClient, ApplicationUserManager userManager ) : Microsoft.AspNet.Identity

Creates an instance of the command negotiator with a specified user manager

Disconnect ( string finalMessage ) : void

Disconnects the client socket

Open ( ) : void

Open the socket, the client gets set up in the constructor

SendWrapper ( IEnumerable strings ) : bool

Wraps sending messages to the connected descriptor

SendWrapper ( string str ) : bool

Wraps sending messages to the connected descriptor

비공개 메소드들

메소드 설명
DataAvailable ( NetworkStream stream ) : Task

Just sits on the stream waiting for a messgae to be sent

DecodeSocket ( byte buffer ) : string

Decodes WS headers and data from the stream

EncodeSocket ( string message ) : Byte[]

Encodes string messages into ws socket language

GetUserIDFromCookie ( string authTicketValue ) : void

Gets the user ID from the web from the aspnet cookie

OnClose ( ) : void

Handles when the connection closes

OnError ( Exception err ) : void

Handles when the connection faults

OnMessage ( string message ) : bool

Handles when the connected descriptor sends input

OnOpen ( ) : void

Handles initial connection

Send ( string message ) : void

Begins the send process for putting data into the socket stream

SendPing ( ) : void

Ping the client for keepalive

StartLoop ( bool>.Func worker ) : void

Handles the wait loop for accepting input from the socket

ValidateUser ( string handshake ) : void

Validates the game account from the aspnet cookie

WriteData ( IAsyncResult result ) : void

Ends the send loop

메소드 상세

Descriptor() 공개 메소드

Creates an instance of the command negotiator
public Descriptor ( TcpClient tcpClient ) : Microsoft.AspNet.Identity
tcpClient System.Net.Sockets.TcpClient
리턴 Microsoft.AspNet.Identity

Descriptor() 공개 메소드

Creates an instance of the command negotiator with a specified user manager
public Descriptor ( TcpClient tcpClient, ApplicationUserManager userManager ) : Microsoft.AspNet.Identity
tcpClient System.Net.Sockets.TcpClient
userManager ApplicationUserManager the authentication manager from the web
리턴 Microsoft.AspNet.Identity

Disconnect() 공개 메소드

Disconnects the client socket
public Disconnect ( string finalMessage ) : void
finalMessage string the final string data to send the socket before closing it
리턴 void

Open() 공개 메소드

Open the socket, the client gets set up in the constructor
public Open ( ) : void
리턴 void

SendWrapper() 공개 메소드

Wraps sending messages to the connected descriptor
public SendWrapper ( IEnumerable strings ) : bool
strings IEnumerable the output
리턴 bool

SendWrapper() 공개 메소드

Wraps sending messages to the connected descriptor
public SendWrapper ( string str ) : bool
str string the output
리턴 bool