03-11-2021 02:24 AM - edited 03-11-2021 02:25 AM
Hi,
I wanted to ask, do you know if there is any command for UDP Port that removes all characters from the input queue of the specified port?
For the RS232 serial port, it is the "FlushInQ" command from the "FlushOutQ" input and output.
I have a problem with taking logs 10 times per second over the UDP line and now I receive them 100 times per second and the program starts to crash rapidly.
I think it's a buffer overflow, but chy may be elsewhere.
Thank you for answer
Have a nice day
04-11-2021 01:34 PM
Hello,
Have you sen this form?
The topic is not directly matching this one but still may be helpful.
04-18-2021 11:50 PM - edited 04-19-2021 12:09 AM
Hello,
thank you for answer.
Logically, it could work, increase the cache.
Unfortunately, I did not find the mentioned register to increase the memory.
Thanks for the help
My data reception code:
int CVICALLBACK UDPCallback (unsigned channel, int eventType, int errCode, void *callbackData)
{
int error = 0,size;
unsigned char *msg = NULL;
//static int Citac=0;
if (eventType == UDP_DATAREADY)
{
char srcAddr[16];
unsigned int srcPort;
char msgSourceString[16 + 10];
int i;
// Pass NULL as the input buffer to determine the size of the arrived data.
errChk (size = UDPRead(channel, NULL, 0, UDP_DO_NOT_WAIT, NULL, NULL));
nullChk (msg = malloc(size));
// Read the waiting message into the allocated buffer.
errChk (size = UDPRead(channel, msg, size, UDP_DO_NOT_WAIT, &srcPort, srcAddr));
msg[size-1]=0x00;
if(g_mereniSGPS) DekodujZpravuGPS(msg);//Dekoduje přijatou zprávu GPS a vyplní proměnné souřadnic a času
}
04-29-2021 03:52 AM
Hello, I searched the registry for the size of the buffer according to this location: HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ Afd \ Parameters \ DefaultReceiveWindow (REG_DWORD) = 16384 (decimal)
Unfortunately it's for windows 7 and for windows 10 I can't find it.
you don't know right innocent location? or can it be set somehow via the command line?
Thank you Nice day