C# Class NetMQ.Core.SessionBase

Inheritance: NetMQ.Core.Own, Pipe.IPipeEvents, IProactorEvents, IMsgSink, IMsgSource
Afficher le fichier Open project: NetMQ/NetMQ3-x Class Usage Examples

Private Properties

Свойство Type Description
CleanPipes void
Create SessionBase
Detached void
ProceedWithTerm void
StartConnecting void

Méthodes publiques

Méthode Description
AttachPipe ( [ pipe ) : void

Attach the given pipe to this session.

This is to be used once only, when creating the session.

Destroy ( ) : void

Terminate and release any contained resources. This cancels the linger-timer if that exists, and terminates the protocol-engine if that exists.

Detach ( ) : void

Flush out any leftover messages and call Detached.

Flush ( ) : void

Flush any messages that are in the pipe downstream.

Hiccuped ( NetMQ.Core.Pipe pipe ) : void
InCompleted ( SocketError socketError, int bytesTransferred ) : void

This method would be called when a message receive operation has been completed, although here it only throws a NotSupportedException.

OutCompleted ( SocketError socketError, int bytesTransferred ) : void

This method would be called when a message Send operation has been completed, although here it only throws a NotSupportedException.

PullMsg ( Msg &msg ) : bool

Read a message from the pipe.

PushMsg ( Msg &msg ) : bool

Write the given Msg to the pipe.

ReadActivated ( NetMQ.Core.Pipe pipe ) : void

Indicate that the given pipe is now ready for reading. Pipe calls this on it's sink in response to ProcessActivateRead.

SessionBase ( [ ioThread, bool connect, [ socket, [ options, [ addr ) : System

Create a new SessionBase object from the given IOThread, socket, and Address.

Terminated ( NetMQ.Core.Pipe pipe ) : void

This gets called by ProcessPipeTermAck or XTerminated to respond to the termination of the given pipe.

TimerEvent ( int id ) : void

This is called when the timer expires.

ToString ( ) : string

Override the ToString method to also show the socket-id.

WriteActivated ( NetMQ.Core.Pipe pipe ) : void

Méthodes protégées

Méthode Description
ProcessAttach ( IEngine engine ) : void

Process the Attach-request by hooking up the pipes and plugging in the given engine.

ProcessPlug ( ) : void

Process the Plug-request by setting this SessionBase as teh handler for the io-object and starting connecting (without waiting).

ProcessTerm ( int linger ) : void

Process a termination request.

Reset ( ) : void

Set the identity-sent and identity-received flags to false.

Private Methods

Méthode Description
CleanPipes ( ) : void

Remove any half processed messages. Flush unflushed messages. Call this function when engine disconnect to get rid of leftovers.

Create ( [ ioThread, bool connect, [ socket, [ options, [ addr ) : SessionBase
Detached ( ) : void

The parent SessionBase class calls this when the Detach method finishes detaching.

ProceedWithTerm ( ) : void

Call this function to move on with the delayed process-termination request.

StartConnecting ( bool wait ) : void

Begin connecting.

Method Details

AttachPipe() public méthode

Attach the given pipe to this session.
This is to be used once only, when creating the session.
public AttachPipe ( [ pipe ) : void
pipe [
Résultat void

Destroy() public méthode

Terminate and release any contained resources. This cancels the linger-timer if that exists, and terminates the protocol-engine if that exists.
public Destroy ( ) : void
Résultat void

Detach() public méthode

Flush out any leftover messages and call Detached.
public Detach ( ) : void
Résultat void

Flush() public méthode

Flush any messages that are in the pipe downstream.
public Flush ( ) : void
Résultat void

Hiccuped() public méthode

public Hiccuped ( NetMQ.Core.Pipe pipe ) : void
pipe NetMQ.Core.Pipe
Résultat void

InCompleted() public méthode

This method would be called when a message receive operation has been completed, although here it only throws a NotSupportedException.
This operation is not supported on the SessionBase class.
public InCompleted ( SocketError socketError, int bytesTransferred ) : void
socketError SocketError a SocketError value that indicates whether Success or an error occurred
bytesTransferred int the number of bytes that were transferred
Résultat void

OutCompleted() public méthode

This method would be called when a message Send operation has been completed, although here it only throws a NotSupportedException.
This operation is not supported on the SessionBase class.
public OutCompleted ( SocketError socketError, int bytesTransferred ) : void
socketError SocketError a SocketError value that indicates whether Success or an error occurred
bytesTransferred int the number of bytes that were transferred
Résultat void

ProcessAttach() protected méthode

Process the Attach-request by hooking up the pipes and plugging in the given engine.
protected ProcessAttach ( IEngine engine ) : void
engine IEngine the IEngine to plug in
Résultat void

ProcessPlug() protected méthode

Process the Plug-request by setting this SessionBase as teh handler for the io-object and starting connecting (without waiting).
protected ProcessPlug ( ) : void
Résultat void

ProcessTerm() protected méthode

Process a termination request.
protected ProcessTerm ( int linger ) : void
linger int a time (in milliseconds) for this to linger before actually going away. -1 means infinite.
Résultat void

PullMsg() public méthode

Read a message from the pipe.
public PullMsg ( Msg &msg ) : bool
msg Msg a reference to a Msg to put the message into
Résultat bool

PushMsg() public méthode

Write the given Msg to the pipe.
public PushMsg ( Msg &msg ) : bool
msg Msg the Msg to push to the pipe
Résultat bool

ReadActivated() public méthode

Indicate that the given pipe is now ready for reading. Pipe calls this on it's sink in response to ProcessActivateRead.
public ReadActivated ( NetMQ.Core.Pipe pipe ) : void
pipe NetMQ.Core.Pipe the pipe to indicate is ready for reading
Résultat void

Reset() protected méthode

Set the identity-sent and identity-received flags to false.
protected Reset ( ) : void
Résultat void

SessionBase() public méthode

Create a new SessionBase object from the given IOThread, socket, and Address.
public SessionBase ( [ ioThread, bool connect, [ socket, [ options, [ addr ) : System
ioThread [ the IOThread for this session to run on
connect bool this flag dictates whether to connect
socket [ the socket to contain
options [ Options that dictate the settings of this session
addr [ an Address that dictates the protocol and IP-address to use when connecting
Résultat System

Terminated() public méthode

This gets called by ProcessPipeTermAck or XTerminated to respond to the termination of the given pipe.
public Terminated ( NetMQ.Core.Pipe pipe ) : void
pipe NetMQ.Core.Pipe the pipe that was terminated
Résultat void

TimerEvent() public méthode

This is called when the timer expires.
public TimerEvent ( int id ) : void
id int an integer used to identify the timer
Résultat void

ToString() public méthode

Override the ToString method to also show the socket-id.
public ToString ( ) : string
Résultat string

WriteActivated() public méthode

public WriteActivated ( NetMQ.Core.Pipe pipe ) : void
pipe NetMQ.Core.Pipe
Résultat void