libgpac
Documentation of the core library of GPAC
Socket Group

Socket IO polling. More...

+ Collaboration diagram for Socket Group:

Functions

GF_SockGroup * gf_sk_group_new ()
 
void gf_sk_group_del (GF_SockGroup *sg)
 
void gf_sk_group_register (GF_SockGroup *sg, GF_Socket *sk)
 
void gf_sk_group_unregister (GF_SockGroup *sg, GF_Socket *sk)
 
GF_Err gf_sk_group_select (GF_SockGroup *sg, u32 wait_usec, GF_SockSelectMode mode)
 
Bool gf_sk_group_sock_is_set (GF_SockGroup *sg, GF_Socket *sk, GF_SockSelectMode mode)
 

Detailed Description

Function Documentation

◆ gf_sk_group_new()

GF_SockGroup* gf_sk_group_new ( )

Creates a new socket group

Returns
socket group object
+ Here is the caller graph for this function:

◆ gf_sk_group_del()

void gf_sk_group_del ( GF_SockGroup *  sg)

Deletes a socket group

Parameters
sgsocket group object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sk_group_register()

void gf_sk_group_register ( GF_SockGroup *  sg,
GF_Socket *  sk 
)

Registers a socket to a socket group

Parameters
sgsocket group object
sksocket object to register
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sk_group_unregister()

void gf_sk_group_unregister ( GF_SockGroup *  sg,
GF_Socket *  sk 
)

Unregisters a socket from a socket group

Parameters
sgsocket group object
sksocket object to unregister
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sk_group_select()

GF_Err gf_sk_group_select ( GF_SockGroup *  sg,
u32  wait_usec,
GF_SockSelectMode  mode 
)

Performs a select (wait) on the socket group

Parameters
sgsocket group object
wait_usecmicroseconds to wait (must be less than one second)
modethe operation mode desired
Returns
error if any - if using a capture file and the capture is done, returns GF_IP_CONNECTION_CLOSED if TCP sockets are present, otherwise GF_EOS
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sk_group_sock_is_set()

Bool gf_sk_group_sock_is_set ( GF_SockGroup *  sg,
GF_Socket *  sk,
GF_SockSelectMode  mode 
)

Checks if given socket is selected and can be read. This shall be called after gf_sk_group_select

Parameters
sgsocket group object
sksocket object to check
modethe operation mode desired
Returns
GF_TRUE if socket is ready to read, 0 otherwise
+ Here is the call graph for this function:
+ Here is the caller graph for this function: