C# Class NetMQ.Devices.DeviceBase

A DeviceBase forwards messages received by a front-end socket to a back-end socket, from which they are then sent, and can contain a Poller.
Inheritance: IDevice
Show file Open project: NetMQ/NetMQ3-x

Protected Properties

Property Type Description
BackendSocket NetMQSocket
FrontendSocket NetMQSocket

Public Methods

Method Description
Initialize ( ) : void

Configure the frontend and backend sockets and then Start this device.

Run ( ) : void

Initiate operation of the Poller associated with this device, if this device owns it. This also sets IsRunning to true.

Start ( ) : void
Stop ( bool waitForCloseToComplete = true ) : void

Stop the device and safely close the underlying sockets.

Protected Methods

Method Description
BackendHandler ( object sender, NetMQSocketEventArgs args ) : void

Invoked when a message has been received by the backend socket.

DeviceBase ( INetMQPoller poller, [ frontendSocket, [ backendSocket, DeviceMode mode ) : System

Create a new instance of the DeviceBase class.

DeviceBase ( NetMQSocket frontendSocket, NetMQSocket backendSocket, DeviceMode mode ) : System

Create a new instance of the DeviceBase class.

FrontendHandler ( object sender, NetMQSocketEventArgs args ) : void

Invoked when a message has been received by the frontend socket.

Method Details

BackendHandler() protected method

Invoked when a message has been received by the backend socket.
protected BackendHandler ( object sender, NetMQSocketEventArgs args ) : void
sender object the object that raised the ReceiveReady event
args NetMQSocketEventArgs a NetMQSocketEventArgs that contains a Socket for receiving data from
return void

DeviceBase() protected method

Create a new instance of the DeviceBase class.
frontendSocket must not be null. backendSocket must not be null.
protected DeviceBase ( INetMQPoller poller, [ frontendSocket, [ backendSocket, DeviceMode mode ) : System
poller INetMQPoller the to use for detecting when messages are available
frontendSocket [ /// A that will pass incoming messages to . ///
backendSocket [ /// A that will receive messages from (and optionally send replies to) . ///
mode DeviceMode the (either Blocking or Threaded) for this device
return System

DeviceBase() protected method

Create a new instance of the DeviceBase class.
protected DeviceBase ( NetMQSocket frontendSocket, NetMQSocket backendSocket, DeviceMode mode ) : System
frontendSocket NetMQSocket /// A that will pass incoming messages to . ///
backendSocket NetMQSocket /// A that will receive messages from (and optionally send replies to) . ///
mode DeviceMode the (either Blocking or Threaded) for this device
return System

FrontendHandler() protected abstract method

Invoked when a message has been received by the frontend socket.
protected abstract FrontendHandler ( object sender, NetMQSocketEventArgs args ) : void
sender object the object that raised the ReceiveReady event
args NetMQSocketEventArgs a NetMQSocketEventArgs that contains a Socket for receiving data from
return void

Initialize() public method

Configure the frontend and backend sockets and then Start this device.
public Initialize ( ) : void
return void

Run() public method

Initiate operation of the Poller associated with this device, if this device owns it. This also sets IsRunning to true.
public Run ( ) : void
return void

Start() public method

public Start ( ) : void
return void

Stop() public method

Stop the device and safely close the underlying sockets.
public Stop ( bool waitForCloseToComplete = true ) : void
waitForCloseToComplete bool If true, this method will block until the /// underlying poller is fully stopped. Defaults to true.
return void

Property Details

BackendSocket protected property

The backend socket that will normally receive messages from (and possibly send replies to) FrontendSocket.
protected NetMQSocket BackendSocket
return NetMQSocket

FrontendSocket protected property

The frontend socket that will normally pass messages to BackendSocket.
protected NetMQSocket FrontendSocket
return NetMQSocket