Listener

Constructor

Visual Basic

Overloads Public Sub New(
 ByVal queue As Queue,
 ByVal messageReceivedEventHandler As MessageReceivedEventHandler,
 ByVal transport As Transport,
 ByVal subject As String,
 ByVal closure As Object )
Overloads Public Sub New(
 ByVal queue As Queue,
 ByVal transport As Transport,
 ByVal subject As String,
 ByVal closure As Object )

C#

public Listener(
    Queue queue,
    MessageReceivedEventHandler messageReceivedEventHandler,
    Transport transport,
    string subject,
    object closure );
public Listener(
    Queue queue,
    Transport transport,
    string subject,
    object closure );

Purpose

Create a listener object to listen for inbound messages.

Remarks

For each inbound message, place the corresponding event on the queue.

Parameter

Description

queue

For each inbound message, place the corresponding event on this event queue.

messageReceivedEventHandler

On dispatch, process the event with this delegate.

Every listener requires a handler delegate. For convenience, supply the delegate to the constructor through this parameter. (It also possible to omit this parameter, and add the handler to the MessageReceived event later, using a .NET call.)

transport

Listen for inbound messages on this transport.

subject

Listen for inbound messages with subjects that match this specification. Wildcard subjects are permitted. Them empty string is not a legal subject name.

closure

Store this closure data in the listener object.

Inbox Listener

To receive unicast (point-to-point) messages, listen to a unique inbox subject name. First call Transport.CreateInbox to create the unique inbox name; then call Listener to begin listening. Remember that other programs have no information about an inbox until the listening program uses it as a reply subject in an outbound message.

See Also

Listener.Destroy

MessageReceivedEventHandler