Ignore:
Timestamp:
Jun 19, 2014 5:07:12 AM (10 years ago)
Author:
riza
Message:

Re #1771: Implement run-time configuration to set specific socket option.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/include/pj/sock.h

    r4538 r4860  
    617617} pj_ip_mreq; 
    618618 
     619/* Maximum number of socket options. */ 
     620#define PJ_MAX_SOCKOPT_PARAMS 4 
     621 
     622/** 
     623 * Options to be set for the socket.  
     624 */ 
     625typedef struct pj_sockopt_params 
     626{ 
     627    /* The number of options to be applied. */ 
     628    unsigned cnt; 
     629 
     630    /* Array of options to be applied. */ 
     631    struct { 
     632        /* The level at which the option is defined. */ 
     633        int level; 
     634 
     635        /* Option name. */ 
     636        int optname; 
     637 
     638        /* Pointer to the buffer in which the option is specified. */ 
     639        void *optval; 
     640 
     641        /* Buffer size of the buffer pointed by optval. */ 
     642        int optlen; 
     643    } options[PJ_MAX_SOCKOPT_PARAMS]; 
     644} pj_sockopt_params; 
    619645 
    620646/***************************************************************************** 
     
    13061332                                         int optlen); 
    13071333 
     1334/** 
     1335 * Set socket options associated with a socket. This method will apply all the  
     1336 * options specified, and ignore any errors that might be raised. 
     1337 * 
     1338 * @param sockfd        The socket descriptor. 
     1339 * @param params        The socket options. 
     1340 * 
     1341 * @return              PJ_SUCCESS or the last error code.  
     1342 */ 
     1343PJ_DECL(pj_status_t) pj_sock_setsockopt_params( pj_sock_t sockfd, 
     1344                                               const pj_sockopt_params *params);                                                
    13081345 
    13091346/** 
Note: See TracChangeset for help on using the changeset viewer.