demo/c/socket/Subscriber.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <XmlBlasterAccessUnparsed.h>

Include dependency graph for Subscriber.c:

Go to the source code of this file.

Functions

static int myUpdate (MsgUnitArr *msgUnitArr, void *userData, XmlBlasterException *exception)
 Here we receive the callback messages from xmlBlaster.
static void callbackProgressListener (void *userP, size_t currBytesRead, size_t nbytes)
 Access the read socket progress.
int main (int argc, char **argv)
 Invoke examples:.

Variables

static char * updateExceptionErrorCode = 0
static char * updateExceptionMessage = 0
static char * subscribeToken = 0
static char * queryType
static int message_counter = 1
static long updateSleep = 0l
static int reportUpdateProgress = 0
static int64_t startTimestamp = 0ll
static int verbose = 1


Function Documentation

static void callbackProgressListener ( void *  userP,
size_t  currBytesRead,
size_t  nbytes 
) [static]

Access the read socket progress.

You need to register this function pointer if you want to see the progress of huge messages on slow connections.

Definition at line 97 of file Subscriber.c.

References XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logLevel, XmlBlasterAccessUnparsed::logUserP, and XMLBLASTER_LOG_WARN.

int main ( int  argc,
char **  argv 
)

Invoke examples:.

Subscriber -logLevel TRACE

Subscriber -session.name Subscriber/1 -dispatch/callback/retries -1 -subscribe/qos/persistent true -interactiveSubscribe true

Definition at line 115 of file Subscriber.c.

References XmlBlasterAccessUnparsed::callbackP, callbackProgressListener(), XmlBlasterAccessUnparsed::connect, XmlBlasterAccessUnparsed::disconnect, ExceptionStruct::errorCode, freeQosArr(), freeXmlBlasterAccessUnparsed(), PropertiesStruct::getBool, PropertiesStruct::getInt, PropertiesStruct::getLong, PropertiesStruct::getString, getXmlBlasterAccessUnparsed(), getXmlBlasterVersion(), CallbackServerUnparsedStruct::hostCB, XmlBlasterAccessUnparsed::initialize, QosStructArr::len, ExceptionStruct::message, myUpdate(), XmlBlasterReadFromSocketFuncHolder::numReadFuncP, XmlBlasterReadFromSocketFuncHolder::numReadUserP, CallbackServerUnparsedStruct::portCB, XmlBlasterAccessUnparsed::props, QosStructArr::qosArr, queryType, CallbackServerUnparsedStruct::readFromSocket, reportUpdateProgress, XmlBlasterAccessUnparsed::subscribe, subscribeToken, XmlBlasterAccessUnparsed::unSubscribe, updateExceptionErrorCode, updateExceptionMessage, updateSleep, verbose, XMLBLASTER_MAX_USAGE_LEN, xmlBlasterAccessUnparsedUsage(), and xmlBlasterFree().

Here is the call graph for this function:

static int myUpdate ( MsgUnitArr msgUnitArr,
void *  userData,
XmlBlasterException exception 
) [static]

Here we receive the callback messages from xmlBlaster.

See also:
UpdateFp in CallbackServerUnparsed.h

Definition at line 31 of file Subscriber.c.

References ExceptionStruct::errorCode, getTimestamp(), MsgUnitStructArr::len, XmlBlasterAccessUnparsed::log, XmlBlasterAccessUnparsed::logUserP, ExceptionStruct::message, message_counter, messageUnitToXmlLimited(), MsgUnitStructArr::msgUnitArr, MsgUnit::responseQos, sleepMillis(), startTimestamp, strcpyAlloc(), strncpy0(), updateExceptionErrorCode, updateExceptionMessage, updateSleep, verbose, XMLBLASTER_LOG_INFO, XMLBLASTEREXCEPTION_ERRORCODE_LEN, XMLBLASTEREXCEPTION_MESSAGE_LEN, and xmlBlasterFree().

Here is the call graph for this function:


Variable Documentation

int message_counter = 1 [static]

Definition at line 21 of file Subscriber.c.

Referenced by myUpdate().

char* queryType [static]

Definition at line 20 of file Subscriber.c.

Referenced by main().

int reportUpdateProgress = 0 [static]

Definition at line 23 of file Subscriber.c.

Referenced by main().

int64_t startTimestamp = 0ll [static]

Definition at line 24 of file Subscriber.c.

Referenced by myUpdate().

char* subscribeToken = 0 [static]

Definition at line 19 of file Subscriber.c.

Referenced by main().

char* updateExceptionErrorCode = 0 [static]

Definition at line 17 of file Subscriber.c.

Referenced by main(), and myUpdate().

char* updateExceptionMessage = 0 [static]

Definition at line 18 of file Subscriber.c.

Referenced by main(), and myUpdate().

long updateSleep = 0l [static]

Definition at line 22 of file Subscriber.c.

Referenced by main(), and myUpdate().

int verbose = 1 [static]

Definition at line 25 of file Subscriber.c.

Referenced by main(), and myUpdate().