#include "dnxClntProt.h"
#include "dnxXml.h"
#include "dnxError.h"
#include "dnxTransport.h"
#include <assert.h>
#include <string.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). |
Definition in file dnxClntProt.c.
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.
[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 . |
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.
[in] | channel | - the channel on which to send pResult . |
[in] | pResult | - the result data to be sent on channel . |
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.
[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. |
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().