Navigation



Ignore:
Timestamp:
Jan 4, 2011 4:20:50 PM (2 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Message:

Prepared first part of the changes for #10

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/freeDiameter.h

    r640 r646  
    371371 
    372372/* 
    373  * FUNCTION:    fd_msg_send 
     373 * FUNCTION:    fd_msg_send, fd_msg_send_timeout   
    374374 * 
    375375 * PARAMETERS: 
    376376 *  pmsg        : Location of the message to be sent on the network (set to NULL on function return to avoid double deletion). 
    377  *  anscb       : A callback to be called when answer is received, if msg is a request (optional) 
     377 *  anscb       : A callback to be called when answer is received, if msg is a request (optional for fd_msg_send) 
    378378 *  anscb_data  : opaque data to be passed back to the anscb when it is called. 
     379 *  timeout     : (only for fd_msg_send_timeout) sets the absolute time until when to wait for an answer. Past this time, 
     380 *                the anscb is called with the request as parameter and the answer will be discarded when received. 
    379381 * 
    380382 * DESCRIPTION:  
     
    399401 * If no callback is registered to handle an answer, the message is discarded and an error is logged. 
    400402 * 
     403 *  fd_msg_send_timeout is similar to fd_msg_send, except that it takes an additional argument "timeout" and can be called 
     404 * only with requests as parameters, and an anscb callback. 
     405 * If the matching answer or error is received before the timeout date passes, everything occurs as with fd_msg_send. Otherwise, 
     406 * the request is removed from the queue (meaning the matching answer will be discarded upon reception) and passed to the answcb  
     407 * function. This function can easily distinguish between timeout case and answer case by checking if the message received is  
     408 * a request. Upon return, if the *msg parameter is not NULL, it is freed (not passed to other callbacks). 
     409 * 
    401410 * RETURN VALUE: 
    402411 *  0           : The message has been queued for sending (sending may fail asynchronously). 
     
    405414 */ 
    406415int fd_msg_send ( struct msg ** pmsg, void (*anscb)(void *, struct msg **), void * data ); 
     416int fd_msg_send_timeout ( struct msg ** pmsg, void (*anscb)(void *, struct msg **), void * data, const struct timespec *timeout ); 
    407417 
    408418/* 
Note: See TracChangeset for help on using the changeset viewer.