<div dir="ltr">Dear Gianluca,<div><br></div><div>thank you very much.</div><div>But does this also means that it could be dangerous to have a pcap session used concurrently by one thread which is running pcap_loop(...,-1...); and another thread which is periodically doing pcap_sendpacket ?<br>
</div><div><br></div><div>Ciao and thanks for your precious support,</div><div><br></div><div>\Carlo<br>
<br><div class="gmail_quote">On Wed, Oct 1, 2008 at 12:40 AM, Gianluca Varenni <span dir="ltr"><<a href="mailto:gianluca.varenni@cacetech.com" target="_blank">gianluca.varenni@cacetech.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#ffffff">
<div><font size="2">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.</font></div><div>
<div><font size="2"></font> </div>
<div><font size="2">Have a nice day</font></div>
<div><font size="2">GV</font></div>
</div><blockquote style="padding-right:0px;padding-left:5px;margin-left:5px;border-left:#000000 2px solid;margin-right:0px"><div>
<div style="font:10pt arial">----- Original Message ----- </div>
<div style="background:#e4e4e4;font:10pt arial"><b>From:</b>
<a title="carlomedas@gmail.com" href="mailto:carlomedas@gmail.com" target="_blank">Carlo
Medas</a> </div>
<div style="font:10pt arial"><b>To:</b> <a title="winpcap-users@winpcap.org" href="mailto:winpcap-users@winpcap.org" target="_blank">winpcap-users@winpcap.org</a> </div>
</div><div><div></div><div><div style="font:10pt arial"><b>Sent:</b> Sunday, September 28, 2008 6:45
AM</div>
<div style="font:10pt arial"><b>Subject:</b> Re: [Winpcap-users]
pcap_sendpacket async or sync behaviour?</div>
<div><br></div>
<div dir="ltr">Dear Gianluca,
<div><br></div>
<div>another question regarding pcap_sendpacket: is it multithread safe?</div>
<div>I mean, can I concurrently call pcap_sendpacket on a same capture session
handle from multiple threads without the need of external
synchronisation?</div>
<div><br></div>
<div>Thanks in advance, your advices are very precious.</div>
<div><br></div>
<div>Ciao,</div>
<div><br></div>
<div>\Carlo<br><br>
<div class="gmail_quote">On Fri, Sep 26, 2008 at 9:00 AM, Carlo Medas <span dir="ltr"><<a href="mailto:carlomedas@gmail.com" target="_blank">carlomedas@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:#ccc 1px solid">
<div dir="ltr">Dear Gianluca,
<div><br></div>
<div>thanks for your more than exaustive answer. The way it works sounds
great for any need, moreover for my needs (network monitoring).</div>
<div><br></div>
<div>Thanks and ciao,</div>
<div><br></div>
<div><font color="#888888">\Carlo</font>
<div>
<div></div>
<div><br><br>
<div class="gmail_quote">On Thu, Sep 25, 2008 at 8:30 PM, Gianluca Varenni
<span dir="ltr"><<a href="mailto:gianluca.varenni@cacetech.com" target="_blank">gianluca.varenni@cacetech.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:#ccc 1px solid">
<div bgcolor="#ffffff">
<div><font size="2">Carlo, </font></div>
<div><font size="2">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.</font></div>
<div><font size="2"></font> </div>
<div><font size="2">Does it make any sense to you?</font></div>
<div><font size="2"></font> </div>
<div><font size="2">Have a nice day</font></div>
<div><font size="2">GV</font></div>
<blockquote style="padding-right:0px;padding-left:5px;margin-left:5px;border-left:#000000 2px solid;margin-right:0px">
<div>
<div></div>
<div>
<div style="font:10pt arial">----- Original Message ----- </div>
<div style="background:#e4e4e4;font:10pt arial"><b>From:</b> <a title="carlomedas@gmail.com" href="mailto:carlomedas@gmail.com" target="_blank">Carlo Medas</a> </div>
<div style="font:10pt arial"><b>To:</b> <a title="winpcap-users@winpcap.org" href="mailto:winpcap-users@winpcap.org" target="_blank">winpcap-users@winpcap.org</a> </div>
<div style="font:10pt arial"><b>Sent:</b> Wednesday, September 24, 2008
10:09 AM</div>
<div style="font:10pt arial"><b>Subject:</b> [Winpcap-users]
pcap_sendpacket async or sync behaviour?</div>
<div><br></div>
<div dir="ltr">Dear all,
<div><br></div>
<div>sorry for newbie question but... I was wondering if pcap_sendpacket
is sync or async.</div>
<div><br></div>
<div>If it's async, do I get a special error reported?</div>
<div>If it's sync, I suppose that it would block until my packet has
been sent?</div>
<div><br></div>
<div>Thank you in advance.</div>
<div><br></div>
<div>Best regards,</div>
<div><br></div>
<div>\Carlo Medas</div></div></div></div>
<p></p>
<hr>
<p></p>_______________________________________________<br>Winpcap-users
mailing list<br><a href="mailto:Winpcap-users@winpcap.org" target="_blank">Winpcap-users@winpcap.org</a><br><a href="https://www.winpcap.org/mailman/listinfo/winpcap-users" target="_blank">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br>
<p></p></blockquote></div><br>_______________________________________________<br>Winpcap-users
mailing list<br><a href="mailto:Winpcap-users@winpcap.org" target="_blank">Winpcap-users@winpcap.org</a><br><a href="https://www.winpcap.org/mailman/listinfo/winpcap-users" target="_blank">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br>
<br></blockquote></div><br></div></div></div></div></blockquote></div><br></div></div>
<p>
</p><hr>
<p></p>_______________________________________________<br>Winpcap-users
mailing
list<br><a href="mailto:Winpcap-users@winpcap.org" target="_blank">Winpcap-users@winpcap.org</a><br><a href="https://www.winpcap.org/mailman/listinfo/winpcap-users" target="_blank">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br>
<p></p></div></div></blockquote></div>
<br>_______________________________________________<br>
Winpcap-users mailing list<br>
<a href="mailto:Winpcap-users@winpcap.org" target="_blank">Winpcap-users@winpcap.org</a><br>
<a href="https://www.winpcap.org/mailman/listinfo/winpcap-users" target="_blank">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br>
<br></blockquote></div><br></div></div>