}
}
+
+
if (go2exit)
return -1;
NetTrans_multiReceive(netTrans, fdSet, theArgs->nrOfMsgs);
for (i = 0; i < theArgs->nrOfMsgs; i++) {
if (FD_ISSET(netTrans[i]->fd, fdSet)) {
- if (assembleMsg(netTrans[i], hadTu[i], hadTuSize[i])) {
+ if (assembleMsg(netTrans[i], hadTu[i], hadTuSize[i])) {
ShmTrans_send(shmTrans[i]);
hadTu[i] = NULL;
}
+ else if (netTrans[i]->discardflag!=0)
+ {
+ unsigned subid=0;
+ char descriptor[DESCLEN];
+ getDataSender(theArgs->portNr[i],&subid,descriptor);
+ sprintf(msglog," <W> Input:%d, port:0x%x subevent:0x%x(%s) - %s", i,theArgs->portNr[i],subid,descriptor, netTrans[i]->discardmessage);
+ storeLogInfo(theArgs, msglog);
+ netTrans[i]->discardflag=0;
+
+ }
+
}
}
#include "worker.h"
#include "nettrans.h"
+static char* transmsglog[300];
+
+#define LOGDISCARDEDMESSAGEINTERVAL 100
+
static int min(int a, int b)
{
return a < b ? a : b;
} else {
size_t size;
+
size = adjustedSize(my, hadTu);
if (my->offset != size || memcmp(HadTu_end(hadTu), hadTu, 32)) {
- (*my->msgsDiscarded)++;
+
+ (*my->msgsDiscarded)++;
+ /* JAM: put here debug output for discarded multieventqueue messages:*/
+ if(((*my->msgsDiscarded) % LOGDISCARDEDMESSAGEINTERVAL)==0)
+ {
+ int cursor=0;
+ my->discardflag=1;
+ if(my->offset != size)
+ {
+
+ cursor=sprintf(my->discardmessage, "assembleMsg: msg %d discarded because packetoffset%d != hadtu size:%d ", (*my->msgsDiscarded), my->offset, size);
+ }
+ if( memcmp(HadTu_end(hadTu), hadTu, 32))
+ {
+ sprintf((my->discardmessage+cursor), "assembleMsg: msg %d discarded because mismatch of hadtu header and trailer", (*my->msgsDiscarded));
+ }
+
+ }
+
+
+
retVal = 0;
} else {
(*my->msgsReceived)++;
unsigned long *msgsReceived;
unsigned long *msgsDiscarded;
unsigned long *bytesReceived;
+ int discardflag;
+ char discardmessage[512];
} NetTrans;
int NetTrans_invariant(const NetTrans *my);