This clears the wait on output flag for sd in the master wait list.
Find the argument registered to the supplied socket descriptor.
Returns the registered pointer else NULL if not found.
| | |
|
int
|
ioctInit( int argc, char** argv )
|
Initialize the connection tracking layer.
The IO Connection Tracking layer is used to track low level IO connections.
| | |
|
int
|
ioctReg( int sd, void* arg, pfi_t cbFunc )
|
Register an argument to the supplied socket desriptor.
When a registered socket disconnects, the registered call-back funtion is called to allow the application to clean up it's own information about the socket.
The call-back prototype: pfi_t callBackFunc( int sd, void *arg );
Deregister a socket (or file) descriptor, remove all call-back references from ioWait's waitlist.
| | |
|
int
|
ioDoEvent( int type, void* option )
|
Execute an event of type "type".
All handlers (call-backs) registered to this event will be called and passed both the "context" which was established at registeration time and the ioDoEvents "option" arguments.
CALL-BACK FUNCTION: int ioEvent( void *registeredContext, void *option)
| | |
|
int
|
ioDupMsg( char* mp, ulong len )
|
Duplicate the message pointed to by "mp" (the header is copied).
The allocated length of the new message is of length "len".
Free a message created by the IO system either by ioMakMsg() or ioRcv().
| | |
|
int
|
ioFwdDst( char* msg, char* dest, int len )
|
Forward an existing message pointed to by "msg", to destination named "dest". The message is of length "len". The message may have originally been created with a much greater length than was actually needed, so "len" indicates the number of bytes to actually transmit. Returns OK if all went well, else ERR. As in all IO send operations, the message space is free after transmission.
| | |
|
int
|
ioFwdId( char* msg, int handle )
|
Simular to ioFwdDst() above but it sends the message across an already existing virtual circuit indicated by "handle". The handle may be acquired by using ioGetHndl( msg* ) or by ioGetPath( dest* ).
| | |
|
int
|
ioGetCfg( char* out, char* name )
|
Get IO configured ports. If "out" points to a NULL string, ioGetCfg goes to the beginning of it's config chain, else it goes to the next entry. The output looks like: PROTO LogicalName Location PhysicalName [EncryptionMeth Key] This is the same information as required by ioAddCfg() above.
| | |
|
int
|
ioGetMsgId( char* msg )
|
Returns the Socket IF of the messages.
| | |
|
ulong
|
ioGetMsgLen( char* msg )
|
Returns the byte count of the message pointed to by "msg".
There is no convenient way to error check this macro's return, so be warned.
| | |
|
int
|
ioGetPath( char* queName )
|
Returns an IO message handle which may be used to create a message or send an existing message. This call looks in it's port chain then it's config chain for a defined queue, then conects to the queue and sends/receives an IO "ping" message. If all went well an IO handle is returned else ERR.
| | |
|
int
|
ioGetHndl( char* msg )
|
Get the handle associated with the message pointed to by "msg".
| | |
|
char*
|
ioGetPeer( char* mp )
|
Return the logical name of the peer process.
Return the thread ID of the IO message.
| | |
|
int
|
ioInit( int argc, char** argv )
|
Initialize the IO system (called from infInit()). Returns argc.
| | |
|
char*
|
ioMakMsg( int handle, ulong len )
|
Create an IO messages of length "len" and associated with IO handle (virtual circuit) "handle".
| | |
|
char*
|
ioMakRsp( char* msg, int length )
|
Create a response message to the existing message pointed to by "msg", and of length "len".
| | |
|
char*
|
ioNew( char* name, int len )
|
Create a new message destined for "name" queue and of length "len". Returns a pointer to a new IO message.
| | |
|
int
|
ioOutBusy( int handle )
|
Returns TRUE if the output queue is not empty, else FALSE if it is. This is used by some processes before exiting to see if their last message has been transmitted.
Open a server queue and begin listening for connection requests.
| | |
|
int
|
ioPing( int hndl, char* msg )
|
Pings are intended to connect or test a virtual circuit and incidentally excahange information about processes.
Send an IO ping message across the circuit refereneced by "handle" then wait for a response.
The ascii string int the buffer pointed to by "msg" will be appended to the ping and buffer will be used to receive the response message.
The receiving process may access the entire ping message by registering a function associated with the event EVTPING.
The caller will get the entire ping response message in it's buffer pointed to by "msg".
The ping message format is: "hostName,procName,PingSeq#,PeerPid,callerMsg"
NOTE: Two events are used "under the covers" to implement ping, EVTPING1 (the request) and EVTPING2 (the reponse).
| | |
|
int
|
ioPingAsync( int hndl, char* msg )
|
Pings are intended to connect or test a virtual circuit and incidentally excahange information about processes.
The asynchronous ping may also be used as a keep alive or stall alarm.
Send an IO ping message across the circuit refereneced by "handle".
The ascii string pointed to by "msg" will be appended to the ping message and then be transmitted to the connection peer process.
If the transmitt was successful, the call returns OK immediately after transmitting the "Ping" request.
If a transmitt error occurred, ERR is returned.
The receiving process may access the entire ping message by registering a function associated with the event EVTPING.
The originating process may see any return message (and determine if the ping was successful) by registering a call-back to event PINGECHO.
The ping message format is: "hostName,procName,PingSeq#,PeerPid,callerMsg"
NOTE: Two events are used "under the covers" to implement ping, EVTPING1 (the request) and EVTPING2 (the reponse).
Receive an IO message.
Returns a message pointer if one is available and NULL if not.
| | |
|
int
|
ioRegEvent( int eventType, pfi_t cbFunc, void* context )
|
Register an event of type "eventType".
When this event occurs the function "cbFunc" will be called and passed this "context" and the ioDoEvent "option" as arguments.
CALL-BACK FUNCTION: int ioEvent( void *registeredContext, void *option)
| | |
|
int
|
ioRegWat( int sd, pfi_t inputCbFunc, pfi_t outputCbFunc, pfi_t exceptionCbFunc, void* contxt )
|
Register an I/O socket (or file) descriptor's callbacks.
The "inputCbFunc" is for input interrupts, the "outputCbFunc" is for output interrupts, and the "exceptionCbFunc" is for exceptions.
The "contxt" variable is provided to all three call-backs.
CALL-BACK FUNCTION: int call-back( void *contxt)
| | |
|
int
|
ioSetWatOut( int sd )
|
This sets the wait on output flag for sd in the master wait list.
| | |
|
int
|
ioSetThd( char* mp, int thd )
|
Sets the threadID in the IO message header.
| | |
|
int
|
ioSetEvt( char* mp, int evt )
|
Sets the event number in the IO message header.
Please see ioRegEvent() for receifing process details.
Was ioSetMsgTyp, a macro for this is now available in io1.h.
| | |
|
int
|
ioSnd( char* mp, ulong len )
|
Sends the low level IO message pointed to by "mp" and of length "len".
This is actually a macro for _ioSnd which requires a pointer pointer to mp (the macro fixes this).
Returns 0 (zero) else ERR.
| | |
|
int
|
wwioWait( int timeout )
|
Wait for "timeout" milliseconds or until an event transpires which returns OK.
Returns OK if an event retuned one else NULL for timeout.
This macro calls ioWaitUs()
| | |
|
int
|
ioWaitUs( int timeout )
|
This is the low level ioWait waits for microseconds.
Wake ioWait before it's timeout.
Caveat: ioWait will return an OK as if a message was received.
ioWakNow returns OK
This is handy for delayed events or signals etc. that need to wake the main line.
A worker thread can signal the main thread which is in ioWait().
| | |
|
int
|
mInit( void* mutexPtr )
|
Initialize the mutex pointed to by "mutexPtr".
Return OK.
| | |
|
int
|
mLck( void* mutexPtr )
|
Lock the mutex pointed to by "mutexPtr".
Return OK.
| | |
|
int
|
mUnLck( void* mutexPtr )
|
Unlock the mutex pointed to by "mutexPtr".
Return OK.