C# Class Helios.Reactor.ReactorBase

Inheritance: IReactor
Mostrar archivo Open project: helios-io/helios Class Usage Examples

Protected Properties

Property Type Description
Listener Socket

Public Methods

Method 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

Protected Methods

Method 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

Method 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 method

public CheckWasDisposed ( ) : void
return void

Configure() public abstract method

public abstract Configure ( IConnectionConfig config ) : void
config IConnectionConfig
return void

CreateNetworkState() protected method

protected CreateNetworkState ( Socket socket, INode remotehost ) : NetworkState
socket Socket
remotehost INode
return Helios.Net.NetworkState

CreateNetworkState() protected method

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

Dispose() public method

public Dispose ( ) : void
return void

Dispose() public abstract method

public abstract Dispose ( bool disposing ) : void
disposing bool
return void

NodeConnected() protected method

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
return void

NodeDisconnected() protected method

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
return void

OnErrorIfNotNull() protected method

protected OnErrorIfNotNull ( Exception reason, IConnection connection ) : void
reason System.Exception
connection IConnection
return void

ReactorBase() protected method

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
return System

ReceivedData() protected method

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
return void

Send() public method

public Send ( NetworkData data ) : void
data Helios.Net.NetworkData
return void

Send() public abstract method

public abstract Send ( byte buffer, int index, int length, INode destination ) : void
buffer byte
index int
length int
destination INode
return void

Start() public method

public Start ( ) : void
return void

StartInternal() protected abstract method

protected abstract StartInternal ( ) : void
return void

Stop() public method

public Stop ( ) : void
return void

StopInternal() protected abstract method

protected abstract StopInternal ( ) : void
return void

Property Details

Listener protected_oe property

protected Socket Listener
return Socket