[Winpcap-users] pcap_sendpacket async or sync behaviour?
Gianluca Varenni
gianluca.varenni at cacetech.com
Tue Sep 30 22:40:10 GMT 2008
Not completely. The problem is that the error buffer used internally in the pcap_t handle is not per_thread. So if two threads try to transmit on the same pcap_t handle and they both fail, you might get garbage in the error message string returned by pcap_geterror.
Have a nice day
GV
----- Original Message -----
From: Carlo Medas
To: winpcap-users at winpcap.org
Sent: Sunday, September 28, 2008 6:45 AM
Subject: Re: [Winpcap-users] pcap_sendpacket async or sync behaviour?
Dear Gianluca,
another question regarding pcap_sendpacket: is it multithread safe?
I mean, can I concurrently call pcap_sendpacket on a same capture session handle from multiple threads without the need of external synchronisation?
Thanks in advance, your advices are very precious.
Ciao,
\Carlo
On Fri, Sep 26, 2008 at 9:00 AM, Carlo Medas <carlomedas at gmail.com> wrote:
Dear Gianluca,
thanks for your more than exaustive answer. The way it works sounds great for any need, moreover for my needs (network monitoring).
Thanks and ciao,
\Carlo
On Thu, Sep 25, 2008 at 8:30 PM, Gianluca Varenni <gianluca.varenni at cacetech.com> wrote:
Carlo,
pcap_sendpacket is basically sync, i.e. it passes the packet to be transmitted to the underlying miniport controlling the NIC, and it waits for such miniport to return. However, the miniport might decide to return success even if the packet has been scheduled to be transmitted (i.e. it's in some transmit queue) but has not actually been transmitted yet.
Does it make any sense to you?
Have a nice day
GV
----- Original Message -----
From: Carlo Medas
To: winpcap-users at winpcap.org
Sent: Wednesday, September 24, 2008 10:09 AM
Subject: [Winpcap-users] pcap_sendpacket async or sync behaviour?
Dear all,
sorry for newbie question but... I was wondering if pcap_sendpacket is sync or async.
If it's async, do I get a special error reported?
If it's sync, I suppose that it would block until my packet has been sent?
Thank you in advance.
Best regards,
\Carlo Medas
------------------------------------------------------------------------
_______________________________________________
Winpcap-users mailing list
Winpcap-users at winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users
_______________________________________________
Winpcap-users mailing list
Winpcap-users at winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users
------------------------------------------------------------------------------
_______________________________________________
Winpcap-users mailing list
Winpcap-users at winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20080930/944ea213/attachment.htm
More information about the Winpcap-users
mailing list