added unixutil to lmessages because of unixstuff.inc compile error
[lcore.git] / lcorewsaasyncselect.pas
index 3f55f1a22470d0c706ed57cb691d96628c162804..b64797ae174c9f2959f0fb776a2be77a04ee481c 100755 (executable)
@@ -141,7 +141,9 @@ begin
 \r
         if readtrigger or writetrigger then lasio.handlefdtrigger(readtrigger,writetrigger);\r
       end;\r
-      dowsaasyncselect(socket,0,0); //reset watches\r
+      // don't reset the event manually for listen sockets to avoid unwanted\r
+      // extra onsessionavailible events\r
+      if (taddrint(findtree(@fdwatches,inttostr(socket))) and (FD_ACCEPT)) = 0 then dowsaasyncselect(socket,0,0); // if not a listen socket reset watches\r
     end;\r
   end else if (ahwnd=hwndlcore) and (aumsg=wm_dotasks) then begin\r
       //writeln('processing tasks');\r