Show Table of Contents
22.11. .NET Class: SessionReceiver
The
SessionReceiver class provides a convenient callback mechanism for messages received by all receivers on a given session.
using Org.Apache.Qpid.Messaging;
using System;
namespace Org.Apache.Qpid.Messaging.SessionReceiver
{
public interface ISessionReceiver
{
void SessionReceiver(Receiver receiver, Message message);
}
public class CallbackServer
{
public CallbackServer(Session session, ISessionReceiver callback);
public void Close();
}
}
To use this class a client program includes references to both
Org.Apache.Qpid.Messaging and Org.Apache.Qpid.Messaging.SessionReceiver. The calling program creates a function that implements the ISessionReceiver interface. This function will be called whenever a message is received by the session. The callback process is started by creating a CallbackServer and will continue to run until the client program calls the CallbackServer.Close function.
A complete operating example of using the
SessionReceiver callback is contained in cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver.
See Also:

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.