summary | 
shortlog | 
log | 
commit | commitdiff | 
tree
raw | 
patch | 
inline | side by side (from parent 1: 
64005e4)
 
 var\r
   FromAddrSize     : LongInt;        // i don't really know what to do with these at this\r
   FromAddr         : TInetSockAddrV;  // at this point time will tell :)\r
 var\r
   FromAddrSize     : LongInt;        // i don't really know what to do with these at this\r
   FromAddr         : TInetSockAddrV;  // at this point time will tell :)\r
+  a,acceptlasterror:integer;\r
 begin\r
   {$ifdef secondlistener}\r
   if (lastsessionfromsecond) then begin\r
 begin\r
   {$ifdef secondlistener}\r
   if (lastsessionfromsecond) then begin\r
   {$else}\r
     result := system_accept(fdhandlein,fromaddr,fromaddrsize);\r
   {$endif}\r
   {$else}\r
     result := system_accept(fdhandlein,fromaddr,fromaddrsize);\r
   {$endif}\r
+\r
+  if (result = -1) then acceptlasterror := {$ifdef mswindows}getlasterror{$else}socketerror{$endif} else acceptlasterror := 0;\r
+\r
   //now we have accepted one request start monitoring for more again\r
   eventcore.rmasterset(fdhandlein,true);\r
 \r
   if result = -1 then begin\r
   //now we have accepted one request start monitoring for more again\r
   eventcore.rmasterset(fdhandlein,true);\r
 \r
   if result = -1 then begin\r
-    raise esocketexception.create('error '+inttostr({$ifdef mswindows}getlasterror{$else}socketerror{$endif})+' while accepting');\r
+    raise esocketexception.create('error '+inttostr(acceptlasterror)+' while accepting');\r
   end;\r
   if result > absolutemaxs then begin\r
     myfdclose(result);\r
   end;\r
   if result > absolutemaxs then begin\r
     myfdclose(result);\r