Changeset 4817 for pjproject


Ignore:
Timestamp:
Apr 15, 2014 8:46:18 AM (8 years ago)
Author:
bennylp
Message:

Closed #1760: added pjsip_tcp_transport_get_socket() API to get the raw socket handle from SIP TCP transport

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_transport_tcp.h

    r4506 r4817  
    205205                                        ); 
    206206 
     207/** 
     208 * Retrieve the internal socket handle used by the TCP transport. Note 
     209 * that this socket normally is registered to ioqueue, so application 
     210 * needs to take care not to perform operation that disrupts ioqueue 
     211 * operation. 
     212 * 
     213 * @param transport     The TCP transport. 
     214 * 
     215 * @return              The socket handle, or PJ_INVALID_SOCKET if no socket 
     216 *                      is currently being used. 
     217 */ 
     218PJ_DECL(pj_sock_t) pjsip_tcp_transport_get_socket(pjsip_transport *transport); 
    207219 
    208220PJ_END_DECL 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c

    r4725 r4817  
    14791479 
    14801480 
     1481PJ_DEF(pj_sock_t) pjsip_tcp_transport_get_socket(pjsip_transport *transport) 
     1482{ 
     1483    struct tcp_transport *tcp = (struct tcp_transport*)transport; 
     1484 
     1485    PJ_ASSERT_RETURN(transport, PJ_INVALID_SOCKET); 
     1486    return tcp->sock; 
     1487} 
     1488 
     1489 
    14811490#endif  /* PJ_HAS_TCP */ 
    14821491 
Note: See TracChangeset for help on using the changeset viewer.