Hi Eric,
I had the same problem some time ago.

If you use wireshark to snif packets, you can see that all packets
arrive on the machine, but not inside the application.

I've done two little programs to test this behaviour:
-udpclient send packets.
-udpserver count lost packets.
I tried them on the same machine and on two different machines, at
different bitrates.

If I resize the window of udpserver, the application began to loose
packets. While using wireshark (winpcap drivers) the lost effect became
more evident.

If the bitrate is not too high (some Mbps) the packet loss is limited,
so the video decoder I use in my real application is strong enough to
correct missing packets.

You can see some consideration about it in "udp packet loss" thread on
the mailing list.

Bye,
Emanuele





Il 14/04/2011 16.14, Éric Fleming Bonilha ha scritto:
> HI François
> 
> I thought on processing speed, but I use a separated thread for I/O
> communication and for testing I have only 1 socket and still dropping
> some packets. And for testing, at a given time, the processor usage is
> always 0%. The received data is not even large, I can notice drops in
> receiving just 20 packets of 1400 bytes of data. In any case, that would
> fit inside winsock buffer, even if my application is hang right?
> 
> I also increased the winsock receive buffer to 256KB. Is there a limit
> of winsock receive buffer?
> 
> Eric
> 
> -----Mensagem Original----- From: Francois PIETTE
> Sent: Thursday, April 14, 2011 2:07 AM
> To: ICS support mailing
> Subject: Re: [twsocket] UDP Receive problem
> 
>> My application receives UDP data from IP Cameras, somehow we are not
>> receiving some
>> 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 cheking for
>> 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.
> 
> 
> -- 
> francois.pie...@overbyte.be
> The author of the freeware multi-tier middleware MidWare
> The author of the freeware Internet Component Suite (ICS)
> http://www.overbyte.be
> 
> -- 
> 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
> -- 
> 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

-- 
Ing. Emanuele Bizzarri
Software Development Department
e-works s.r.l.
41011 - Campogalliano - Modena - Italy
tel. +39 059 2929081 int. 23
fax +39 059 2925035

e-mail: e.bizza...@e-works.it - http://www.e-works.it
---------------------------------------------------------------------
La presente comunicazione, che potrebbe contenere informazioni riservate
e/o protette da segreto professionale, è indirizzata esclusivamente ai
destinatari della medesima qui indicati. Le opinioni, le conclusioni e
le altre informazioni qui contenute, che non siano relative alla nostra
attività caratteristica, devono essere considerate come non inviate né
avvalorate da noi. Tutti i pareri e le informazioni qui contenuti sono
soggetti ai termini ed alle condizioni previsti dagli accordi che
regolano il nostro rapporto con il cliente. Nel caso in cui abbiate
ricevuto per errore la presente comunicazione, vogliate cortesemente
darcene immediata notizia, rispondendo a questo stesso indirizzo di
e-mail, e poi procedere alla cancellazione di questo messaggio dal
Vostro sistema. E' strettamente proibito e potrebbe essere fonte di
violazione di legge qualsiasi uso, comunicazione, copia o diffusione dei
contenuti di questa comunicazione da parte di chi la abbia ricevuta per
errore o in violazione degli scopi della presente.
---------------------------------------------------------------------
This communication, that may contain confidential and/or legally
privileged information, is intended solely for the use of the intended
addressees. Opinions, conclusions and other information contained in
this message, that do not relate to the official business of this firm,
shall be considered as not given or endorsed by it. Every opinion or
advice contained in this communication is subject to the terms and
conditions provided by the agreement governing the engagement with such
a client. If you have received this communication in error, please
notify us immediately by responding to this email and then delete it
from your system. Any use, disclosure, copying or distribution of the
contents of this communication by a not-intended recipient or in
violation of the purposes of this communication is strictly prohibited
and may be unlawful.

--
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

Reply via email to