dnxSrvProt.c File Reference

Implements the server-side DNX communications methods. More...

#include "dnxSrvProt.h"
#include "dnxXml.h"
#include "dnxError.h"
#include "dnxDebug.h"
#include <assert.h>
#include <string.h>

Go to the source code of this file.

Functions

int dnxSendJob (DnxChannel *channel, DnxJob *pJob, char *address)
 Dispatch a job to a client node (server).
int dnxWaitForNodeRequest (DnxChannel *channel, DnxNodeRequest *pReg, char *address, int timeout)
 Wait for a node request (server).
int dnxWaitForResult (DnxChannel *channel, DnxResult *pResult, char *address, int timeout)
 Collect job results from a client (server).


Detailed Description

Implements the server-side DNX communications methods.

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

Definition in file dnxSrvProt.c.


Function Documentation

int dnxSendJob ( DnxChannel channel,
DnxJob pJob,
char *  address 
)

Dispatch a job to a client node (server).

Parameters:
[in] channel - the channel on which to send pJob.
[in] pJob - the job request to be sent on channel.
[in] address - the address to which pJob should be sent. This parameter is optional, and may be specified as NULL, in which case the channel address will be used.
Returns:
Zero on success, or a non-zero error value.

Definition at line 48 of file dnxSrvProt.c.

References DnxXmlBuf::buf, DnxJob::cmd, DNX_XML_INT, DNX_XML_STR, DNX_XML_XID, dnxDebug(), dnxPut(), dnxXmlAdd(), dnxXmlClose(), dnxXmlOpen(), DnxJob::priority, DnxXmlBuf::size, DnxJob::state, DnxJob::timeout, and DnxJob::xid.

int dnxWaitForNodeRequest ( DnxChannel channel,
DnxNodeRequest pReg,
char *  address,
int  timeout 
)

Wait for a node request (server).

Parameters:
[in] channel - the channel from which to receive the node request.
[out] pReg - the address of storage into which the request should be read from channel.
[out] address - the address of storage in which to return the address of the sender. This parameter is optional and may be passed as NULL. If non-NULL, it should be large enough to store sockaddr_* data.
[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 85 of file dnxSrvProt.c.

References DnxNodeRequest::addrstr, DnxXmlBuf::buf, DNX_OK, DNX_XML_INT, DNX_XML_XID, dnxDebug(), dnxGet(), dnxNtop(), dnxXmlCmpStr(), dnxXmlGet(), DnxNodeRequest::jobCap, DnxNodeRequest::reqType, DnxXmlBuf::size, DnxNodeRequest::ttl, and DnxNodeRequest::xid.

int dnxWaitForResult ( DnxChannel channel,
DnxResult pResult,
char *  address,
int  timeout 
)

Collect job results from a client (server).

Parameters:
[in] channel - the channel from which to receive the job result.
[out] pResult - the address of storage into which the job result should be read from channel.
[out] address - the address of storage in which to return the address of the sender. This parameter is optional and may be passed as NULL. If non-NULL, it should be large enough to store sockaddr_* data.
[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 147 of file dnxSrvProt.c.

References DnxXmlBuf::buf, DnxResult::delta, DNX_OK, DNX_XML_INT, DNX_XML_STR, DNX_XML_UINT, DNX_XML_XID, dnxDebug(), dnxGet(), dnxXmlCmpStr(), dnxXmlGet(), DnxResult::resCode, DnxResult::resData, DnxXmlBuf::size, DnxResult::state, and DnxResult::xid.


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