C# Class Helios.Reactor.ReactorBase

Inheritance: IReactor
Afficher le fichier Open project: helios-io/helios Class Usage Examples

Protected Properties

Свойство Type Description
Listener Socket

Méthodes publiques

Méthode Description
CheckWasDisposed ( ) : void
Configure ( IConnectionConfig config ) : void
Dispose ( ) : void
Dispose ( bool disposing ) : void
Send ( NetworkData data ) : void
Send ( byte buffer, int index, int length, INode destination ) : void
Start ( ) : void
Stop ( ) : void

Méthodes protégées

Méthode Description
CreateNetworkState ( Socket socket, INode remotehost ) : NetworkState
CreateNetworkState ( Socket socket, INode remotehost, IByteBuf buffer, int bufferSize ) : NetworkState
NodeConnected ( INode node, IConnection responseChannel ) : void

Invoked when a new node has connected to this server

NodeDisconnected ( HeliosConnectionException reason, IConnection closedChannel ) : void

Invoked when a node's connection to this server has been disconnected

OnErrorIfNotNull ( Exception reason, IConnection connection ) : void
ReactorBase ( IPAddress localAddress, int localPort, NetworkEventLoop eventLoop, IMessageEncoder encoder, IMessageDecoder decoder, IByteBufAllocator allocator, SocketType socketType = SocketType.Stream, ProtocolType protocol = ProtocolType.Tcp, int bufferSize = NetworkConstants.DEFAULT_BUFFER_SIZE ) : System
ReceivedData ( NetworkData availableData, ReactorResponseChannel responseChannel ) : void

Abstract method to be filled in by a child class - data received from the network is injected into this method via the NetworkData data type.

StartInternal ( ) : void
StopInternal ( ) : void

Private Methods

Méthode Description
CloseConnection ( Exception reason, IConnection remoteHost ) : void
CloseConnection ( IConnection remoteHost ) : void

Closes a connection to a remote host (without shutting down the server.)

Method Details

CheckWasDisposed() public méthode

public CheckWasDisposed ( ) : void
Résultat void

Configure() public abstract méthode

public abstract Configure ( IConnectionConfig config ) : void
config IConnectionConfig
Résultat void

CreateNetworkState() protected méthode

protected CreateNetworkState ( Socket socket, INode remotehost ) : NetworkState
socket Socket
remotehost INode
Résultat Helios.Net.NetworkState

CreateNetworkState() protected méthode

protected CreateNetworkState ( Socket socket, INode remotehost, IByteBuf buffer, int bufferSize ) : NetworkState
socket Socket
remotehost INode
buffer IByteBuf
bufferSize int
Résultat Helios.Net.NetworkState

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Dispose() public abstract méthode

public abstract Dispose ( bool disposing ) : void
disposing bool
Résultat void

NodeConnected() protected méthode

Invoked when a new node has connected to this server
protected NodeConnected ( INode node, IConnection responseChannel ) : void
node INode The instance that just connected
responseChannel IConnection The channel that the server can respond to
Résultat void

NodeDisconnected() protected méthode

Invoked when a node's connection to this server has been disconnected
protected NodeDisconnected ( HeliosConnectionException reason, IConnection closedChannel ) : void
reason Helios.Exceptions.HeliosConnectionException The reason why this node disconnected
closedChannel IConnection The instance that just closed
Résultat void

OnErrorIfNotNull() protected méthode

protected OnErrorIfNotNull ( Exception reason, IConnection connection ) : void
reason System.Exception
connection IConnection
Résultat void

ReactorBase() protected méthode

protected ReactorBase ( IPAddress localAddress, int localPort, NetworkEventLoop eventLoop, IMessageEncoder encoder, IMessageDecoder decoder, IByteBufAllocator allocator, SocketType socketType = SocketType.Stream, ProtocolType protocol = ProtocolType.Tcp, int bufferSize = NetworkConstants.DEFAULT_BUFFER_SIZE ) : System
localAddress System.Net.IPAddress
localPort int
eventLoop Helios.Net.NetworkEventLoop
encoder IMessageEncoder
decoder IMessageDecoder
allocator IByteBufAllocator
socketType SocketType
protocol ProtocolType
bufferSize int
Résultat System

ReceivedData() protected méthode

Abstract method to be filled in by a child class - data received from the network is injected into this method via the NetworkData data type.
protected ReceivedData ( NetworkData availableData, ReactorResponseChannel responseChannel ) : void
availableData Helios.Net.NetworkData Data available from the network, including a response address
responseChannel Helios.Reactor.Response.ReactorResponseChannel Available channel for handling network response
Résultat void

Send() public méthode

public Send ( NetworkData data ) : void
data Helios.Net.NetworkData
Résultat void

Send() public abstract méthode

public abstract Send ( byte buffer, int index, int length, INode destination ) : void
buffer byte
index int
length int
destination INode
Résultat void

Start() public méthode

public Start ( ) : void
Résultat void

StartInternal() protected abstract méthode

protected abstract StartInternal ( ) : void
Résultat void

Stop() public méthode

public Stop ( ) : void
Résultat void

StopInternal() protected abstract méthode

protected abstract StopInternal ( ) : void
Résultat void

Property Details

Listener protected_oe property

protected Socket Listener
Résultat Socket