C# Класс NetMud.Websock.Descriptor

Main handler of descriptor connections for websockets
Наследование: NetMud.Websock.Channel, IDescriptor
Показать файл Открыть проект

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