dnxClntProt.h File Reference

Types and definitions for DNX messaging protocol. More...

#include "dnxProtocol.h"

Go to the source code of this file.

Functions

int dnxSendNodeRequest (DnxChannel *channel, DnxNodeRequest *pReg)
 Request a job from the registrar (client).
int dnxWaitForJob (DnxChannel *channel, DnxJob *pJob, int timeout)
 Wait for a job from the dispatcher (client).
int dnxSendResult (DnxChannel *channel, DnxResult *pResult)
 Report a job result to the collector (client).


Detailed Description

Types and definitions for DNX messaging protocol.

Author:
Robert W. Ingraham (dnx-devel@lists.sourceforge.net)
Attention:
Please submit patches to http://dnx.sourceforge.net

Definition in file dnxClntProt.h.


Function Documentation

int dnxSendNodeRequest ( DnxChannel channel,
DnxNodeRequest pReg 
)

Request a job from the registrar (client).

The request can only be sent to the connected address on the channel. The timeout is forever, which means this function will block till the entire message is sent.

Parameters:
[in] channel - the channel from which to receive the job request.
[out] pReg - the address of storage into which the request should be read from channel.
Returns:
Zero on success, or a non-zero error value.

Definition at line 49 of file dnxClntProt.c.

References DnxXmlBuf::buf, DNX_XML_INT, DNX_XML_UINT, DNX_XML_XID, dnxDebug(), dnxPut(), dnxXmlAdd(), dnxXmlClose(), dnxXmlOpen(), DnxNodeRequest::jobCap, DnxNodeRequest::reqType, DnxXmlBuf::size, DnxNodeRequest::ttl, and DnxNodeRequest::xid.

Referenced by dnxWorker().

int dnxSendResult ( DnxChannel channel,
DnxResult pResult 
)

Report a job result to the collector (client).

The result is sent to the peer the socket is connected to.

Parameters:
[in] channel - the channel on which to send pResult.
[in] pResult - the result data to be sent on channel.
Returns:
Zero on success, or a non-zero error value.

Definition at line 139 of file dnxClntProt.c.

References DnxXmlBuf::buf, DnxResult::delta, DNX_XML_INT, DNX_XML_STR, DNX_XML_UINT, DNX_XML_XID, dnxDebug(), dnxPut(), dnxXmlAdd(), dnxXmlClose(), dnxXmlOpen(), DnxResult::resCode, DnxResult::resData, DnxXmlBuf::size, DnxResult::state, and DnxResult::xid.

Referenced by dnxWorker().

int dnxWaitForJob ( DnxChannel channel,
DnxJob pJob,
int  timeout 
)

Wait for a job from the dispatcher (client).

No address is returned, because only one remote peer can ever send to a connected socket.

Parameters:
[in] channel - the channel from which to receive the job request.
[out] pJob - the address of storage into which the job request should be read from channel.
[in] timeout - the maximum number of seconds the caller is willing to wait before accepting a timeout error.
Returns:
Zero on success, or a non-zero error value.

Definition at line 86 of file dnxClntProt.c.

References DnxXmlBuf::buf, DnxJob::cmd, DNX_OK, DNX_XML_INT, DNX_XML_STR, DNX_XML_XID, dnxDebug(), dnxGet(), dnxXmlCmpStr(), dnxXmlGet(), DnxJob::priority, DnxXmlBuf::size, DnxJob::state, DnxJob::timeout, and DnxJob::xid.

Referenced by dnxWorker().


Generated on Tue Apr 13 15:48:07 2010 for DNX by  doxygen 1.5.6