Go to the first, previous, next, last section, table of contents.


isdio

When calling either isdSend() or isdRecv(), an important parameter is the address of a structure of type isdHeader *. The definition appears in the file isdio.h which should be included before calling any of the isd* functions. Though only two functions require the header, the file defines the prototypes for all the calls.

isdHeader

typedef struct {
    long len;
    long sequence;
    short reply;
    short error;
    short command;
    short version;
    unsigned long workerid;
    short more;
    short unused[17];
    double aligner;
} isdHeader;

len is the number of bytes in the message being sent (isdSend()) or that were received (isdRecv()). Programmers should not set this value as it will be overwritten by both isdSend() and isdRecv().

sequence is unused by isectd. It was intended to allow programmers to assign sequence numbers to the messages.

reply is non-zero if the client is going to wait for a reply. If reply is zero a repsonse to the messages will not be sent to the client by isectd whether or not the worker sent one.

error, command, and version are reserved. The latter being intended to provide backward compatibility in the event the isdHeader changes in future revisions.

workerid may be set by isectd in the case the worker is waiting for additional information from the client. The client should reply immediately since the worker is unavailable for other clients while waiting. This should only occur in circumstances the programmer intended (never by accident).

Set more to a non-zero value if either the worker or the client intends to send more messages as part of a request. This is valuable when either a client or a worker doesn't have all the information necessary for either a request or a response at one time. Isectd won't mark a worker idle until it sends a packet with more == 0.

unused is unused--accept that it pads the message to 64 bytes.

aligner is used to align the packet to as long a word-boundary as possible--which normally works for most architectures. Someone should let me know when all compilers implement #assert directives so I can #assert sizeof isdHeader == 64 at compile time and save programmers the trouble of linking before things blow up. The Data General C compiler implemented this and I loved it.


Go to the first, previous, next, last section, table of contents.