Sun Java Communications Suite 5 Event Notification Service Guide

subscriber_new_a

Purpose

Creates a new asynchronous subscriber.

Syntax

void subscriber_new_a (pas_dispatcher_t *disp,
                       void *worker,
                       const char *host,
                       unsigned short port,
                       subscriber_cb_t cbdone,
                       void *cbarg);

Parameters

disp

Thread dispatcher context returned by pas_dispatcher_new.

worker

Application worker. If not NULL, grouped with existing workers created by ENS to service this subscriber session. Used to prevent multiple threads from accessing the subscriber data at the same time. Only usable if the caller creates and dispatches the GDisp context. 

host

Notification server host name or IP address. 

port

Subscription service port number. 

cbdone

The callback invoked when the subscriber session becomes active and subscriptions can be issued. 

There are three parameters to cbdone:

  • cbarg

    The first argument.

  • A status code.

    If non-zero, the subscriber could not be created; value specifies cause of the failure.

  • The new active subscriber (subscriber_t).

cbarg

First argument of cbdone.

Returns

Nothing. It passes the new active subscriber as third argument of cbdone callback.