My application receives UDP data from IP Cameras, somehow we are not
packets, but by using a network sniffer I can see that the packet was
received, but the
application never receives it!
I already checked receive buffer lengths.. I actually spent 2 entire days
solutions but I couldn´t find anything
At first glance, I would say that your receiving application is not able to
receive the datagrams as fast as they are comming. So they are simply
dropped from winsock buffer as new datagrams are comming in.
I suggest you use a different thread for the newtork I/O (TWSocket) and for
the computation and display. Let's name the thread with TWSocket a "worker
thread". The worker thread can be assigne high priority and build a large
buffer to store datagrams until the main thread is able to process it. Pay
attention to not use anything taking time ! Specially, do not use
Synchronize. Of course you need a critical section to have the main thread
and worker thread to acces the queue at the same time. Pay a lot of
attention to the duration of the lock, make it as small as possible or you
are back to your initial issue.
Also note that this design will potentially cause trouble if the overall
computation and display time is slower than the average network I/O speed,
the your buffer will grow. At some time you'll be forced to drop datagrams
yourself to avoid accumulating data.
Another possibility is that you have a bug in your application which makes
some datagrams unprocessed.
Yest another possibility is that you have a "security product" which is
bugged or takes too long to process. Many security product intercept the
network I/O to check for malware.
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be