mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-15 15:53:55 +00:00
1. Modified WebRTC_DataChannel to use union, to simplify struct def
2. Added ChainLink MetaData 3. Added 'ChainViewer' to allow JS to debug Chain events
This commit is contained in:
@@ -2625,6 +2625,37 @@ void ILibChain_DisableWatchDog(void *chain)
|
||||
((ILibBaseChain*)chain)->nowatchdog = 1;
|
||||
}
|
||||
|
||||
void *ILibChain_GetObjectForDescriptor(void *chain, int fd)
|
||||
{
|
||||
void *ret = NULL;
|
||||
ILibChain_Link *module;
|
||||
void *node = ILibLinkedList_GetNode_Head(((ILibBaseChain*)chain)->Links);
|
||||
int selectTimeout = UPNP_MAX_WAIT * 1000;
|
||||
|
||||
fd_set readset;
|
||||
fd_set errorset;
|
||||
fd_set writeset;
|
||||
|
||||
while (node != NULL && (module = (ILibChain_Link*)ILibLinkedList_GetDataFromNode(node)) != NULL)
|
||||
{
|
||||
if (module->PreSelectHandler != NULL)
|
||||
{
|
||||
FD_ZERO(&readset);
|
||||
FD_ZERO(&errorset);
|
||||
FD_ZERO(&writeset);
|
||||
|
||||
module->PreSelectHandler(module, &readset, &writeset, &errorset, &selectTimeout);
|
||||
if (FD_ISSET(fd, &readset) || FD_ISSET(fd, &writeset) || FD_ISSET(fd, &errorset))
|
||||
{
|
||||
ret = module;
|
||||
break;
|
||||
}
|
||||
}
|
||||
node = ILibLinkedList_GetNextNode(node);
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/*! \fn ILibStartChain(void *Chain)
|
||||
\brief Starts a Chain
|
||||
\par
|
||||
|
||||
Reference in New Issue
Block a user