<div dir="ltr">Thanks. I tried simply guard all access to 'peer' (the line of peer->address is commented out), still not working. My code at: <a href="http://pastebin.com/QJhH871p">http://pastebin.com/QJhH871p</a> , what do I miss?</div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-22 22:05 GMT+08:00 Lee Salzman <span dir="ltr"><<a href="mailto:lsalzman@gmail.com" target="_blank">lsalzman@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You would have to guard all access to ENetPeer as well, including<br>
enet_peer_send and peer->address.<br>
<div><div class="h5"><br>
On Fri, Jan 22, 2016 at 1:27 AM, aj3423 <<a href="mailto:aj3423@gmail.com">aj3423@gmail.com</a>> wrote:<br>
> My server should receive message from client and echo back some message, but<br>
> in my case building the message packet costs time, so I need to create a<br>
> thread to echo message to clients.<br>
><br>
> I wrote a test to illustrate this problem, the client runs a infinit loop,<br>
> sending 2k data to server and receive 2k data. The server crashes after a<br>
> while, randomly. the code:<br>
><br>
> server: <a href="http://pastebin.com/99kpQgTJ" rel="noreferrer" target="_blank">http://pastebin.com/99kpQgTJ</a><br>
> client:  <a href="http://pastebin.com/wX8jfZgk" rel="noreferrer" target="_blank">http://pastebin.com/wX8jfZgk</a><br>
><br>
> It crashes at function enet_host_flush, I tried to use `std::mutex` but<br>
> doesn't help. Any idea? Thanks.<br>
><br>
> My Environment: Win7 32bit + VS2013 + Enet 1.3.13<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> ENet-discuss mailing list<br>
> <a href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a><br>
> <a href="http://lists.cubik.org/mailman/listinfo/enet-discuss" rel="noreferrer" target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br>
><br>
_______________________________________________<br>
ENet-discuss mailing list<br>
<a href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a><br>
<a href="http://lists.cubik.org/mailman/listinfo/enet-discuss" rel="noreferrer" target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br>
</blockquote></div><br></div>