C# Class NetMQ.Core.Transports.Tcp.TcpConnector

If 'delay' is true connector first waits for a while, then starts connection process.
Inheritance: Own, IProactorEvents
Datei anzeigen Open project: zeromq/netmq

Public Methods

Method Description
Destroy ( ) : void

This does nothing.

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 NotImplementedException.

OutCompleted ( SocketError socketError, int bytesTransferred ) : void

This method is called when a message Send operation has been completed.

TcpConnector ( [ ioThread, [ session, [ options, [ addr, bool delayedStart ) : System

Create a new TcpConnector object.

TimerEvent ( int id ) : void

This is called when the timer expires - to start trying to connect.

Protected Methods

Method Description
ProcessPlug ( ) : void

Begin connecting. If a delayed-start was specified - then the reconnect-timer is set, otherwise this starts immediately.

ProcessTerm ( int linger ) : void

Process a termination request. This cancels the reconnect-timer, closes the AsyncSocket, and marks the socket-handle as invalid.

Private Methods

Method Description
AddReconnectTimer ( ) : void

Internal function to add a reconnect timer

Close ( ) : void

Close the connecting socket.

GetNewReconnectIvl ( ) : int

Internal function to return a reconnect back-off delay. Will modify the current_reconnect_ivl used for next call Returns the currently used interval

StartConnecting ( ) : void

Internal function to start the actual connection establishment.

Method Details

Destroy() public method

This does nothing.
public Destroy ( ) : void
return void

InCompleted() public method

This method would be called when a message receive operation has been completed, although here it only throws a NotImplementedException.
InCompleted must not be called on a TcpConnector.
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
return void

OutCompleted() public method

This method is called when a message Send operation has been completed.
A non-recoverable socket error occurred. If the socketError is not Success then it must be a valid recoverable error.
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
return void

ProcessPlug() protected method

Begin connecting. If a delayed-start was specified - then the reconnect-timer is set, otherwise this starts immediately.
protected ProcessPlug ( ) : void
return void

ProcessTerm() protected method

Process a termination request. This cancels the reconnect-timer, closes the AsyncSocket, and marks the socket-handle as invalid.
protected ProcessTerm ( int linger ) : void
linger int a time (in milliseconds) for this to linger before actually going away. -1 means infinite.
return void

TcpConnector() public method

Create a new TcpConnector object.
public TcpConnector ( [ ioThread, [ session, [ options, [ addr, bool delayedStart ) : System
ioThread [ the I/O-thread for this TcpConnector to live on.
session [ the session that will contain this
options [ Options that define this new TcpC
addr [ the Address for this Tcp to connect to
delayedStart bool this boolean flag dictates whether to wait before trying to connect
return System

TimerEvent() public method

This is called when the timer expires - to start trying to connect.
public TimerEvent ( int id ) : void
id int The timer-id. This is not used.
return void