static PARCBuffer * _internalRECEIVE(_TemplateLinkData *linkData) { PARCBuffer *wireFormatBuffer = NULL; if (parcDeque_Size(linkData->queue) > 0) { // if there's another message, send it. wireFormatBuffer = parcDeque_RemoveFirst(linkData->queue); } return wireFormatBuffer; }
// // Return a message which has been queued on this link from a UDP listener // static CCNxMetaMessage * _UDPReceiveProxy(AthenaTransportLink *athenaTransportLink) { CCNxMetaMessage *ccnxMetaMessage = NULL; struct _UDPLinkData *linkData = athenaTransportLink_GetPrivateData(athenaTransportLink); if (parcDeque_Size(linkData->queue) > 0) { ccnxMetaMessage = parcDeque_RemoveFirst(linkData->queue); if (parcDeque_Size(linkData->queue) > 0) { // if there's another message, post an event. athenaTransportLink_SetEvent(athenaTransportLink, AthenaTransportLinkEvent_Receive); } } return ccnxMetaMessage; }
static void _UDPLinkData_Destroy(_UDPLinkData **linkData) { // remove any queued messages if ((*linkData)->queue) { while (parcDeque_Size((*linkData)->queue) > 0) { CCNxMetaMessage *ccnxMetaMessage = parcDeque_RemoveFirst((*linkData)->queue); ccnxMetaMessage_Release(&ccnxMetaMessage); } parcDeque_Release(&((*linkData)->queue)); } if ((*linkData)->multiplexTable) { parcHashCodeTable_Destroy(&((*linkData)->multiplexTable)); } parcMemory_Deallocate(linkData); }