C# Класс OpenStory.Networking.EncryptedNetworkSession

Наследование: INetworkSession, IDisposable
Показать файл Открыть проект

Открытые методы

Метод Описание
AttachSocket ( Socket sessionSocket ) : void

Attaches a Socket to this session.

Close ( string reason ) : void

Closes the session.

Dispose ( ) : void
ToString ( ) : string
WritePacket ( byte packet ) : void

Encrypts the given data as a packet and writes it to the network stream.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Runs the disposal operations for the base class.

EncryptedNetworkSession ( ) : System

Initializes a new instance of the EncryptedNetworkSession class with no specified socket.

Call AttachSocket(Socket) before starting the network operations.

OnDataArrived ( object sender, DataArrivedEventArgs args ) : void

Called when the PacketReceived event is raised.

When overriding this method in a derived class, call the base implementation after your logic.

ThrowIfNoPacketReceivedSubscriber ( ) : void

Checks if the PacketReceived event has a subscriber and throws InvalidOperationException if not.

Приватные методы

Метод Описание
CreateInnerSession ( ) : NetworkSession
OnClosing ( object sender, ConnectionClosingEventArgs e ) : void
OnPacketReceived ( PacketReceivedEventArgs args ) : void
OnSocketError ( object sender, SocketErrorEventArgs e ) : void

Описание методов

AttachSocket() публичный Метод

Attaches a Socket to this session.
public AttachSocket ( Socket sessionSocket ) : void
sessionSocket System.Net.Sockets.Socket The to attach.
Результат void

Close() публичный Метод

Closes the session.
public Close ( string reason ) : void
reason string
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Runs the disposal operations for the base class.
protected Dispose ( bool disposing ) : void
disposing bool Whether the method is being called for disposal or finalization.
Результат void

EncryptedNetworkSession() защищенный Метод

Initializes a new instance of the EncryptedNetworkSession class with no specified socket.
Call AttachSocket(Socket) before starting the network operations.
protected EncryptedNetworkSession ( ) : System
Результат System

OnDataArrived() защищенный Метод

Called when the PacketReceived event is raised.
When overriding this method in a derived class, call the base implementation after your logic.
Thrown if is .
protected OnDataArrived ( object sender, DataArrivedEventArgs args ) : void
sender object The sender of the event.
args DataArrivedEventArgs The packet data that was received.
Результат void

ThrowIfNoPacketReceivedSubscriber() защищенный Метод

Checks if the PacketReceived event has a subscriber and throws InvalidOperationException if not.
protected ThrowIfNoPacketReceivedSubscriber ( ) : void
Результат void

ToString() публичный Метод

public ToString ( ) : string
Результат string

WritePacket() публичный Метод

Encrypts the given data as a packet and writes it to the network stream.
/// Thrown if is . ///
public WritePacket ( byte packet ) : void
packet byte The data to send.
Результат void