tempsocket : tlasio ;\r
socketcount : integer ; // for debugging perposes :)\r
dw,bt:integer;\r
tempsocket : tlasio ;\r
socketcount : integer ; // for debugging perposes :)\r
dw,bt:integer;\r
+ //writeln('entering processasios');\r
{ inc(lcoretestcount);}\r
\r
//the message loop will exit if all lasio's and ltimer's and lsignal's are destroyed\r
{ inc(lcoretestcount);}\r
\r
//the message loop will exit if all lasio's and ltimer's and lsignal's are destroyed\r
for dw := (maxs shr 5) downto 0 do if (fdsr[dw] or fdsw[dw]) <> 0 then begin\r
for bt := 0 to 31 do if (fdsr[dw] or fdsw[dw]) and (1 shl bt) <> 0 then begin\r
inc(socketcount);\r
for dw := (maxs shr 5) downto 0 do if (fdsr[dw] or fdsw[dw]) <> 0 then begin\r
for bt := 0 to 31 do if (fdsr[dw] or fdsw[dw]) and (1 shl bt) <> 0 then begin\r
inc(socketcount);\r
- currentsocket := fdreverse[dw shl 5 or bt];\r
+ fd := dw shl 5 or bt;\r
+ //writeln('reversing fd ',fd);\r
+ currentsocket := fdreverse[fd];\r
{if not assigned(currentsocket) then raise exception.create('currentsocket not assigned');\r
if currentsocket.fdhandlein < 0 then raise exception.create('currentsocket.fdhandlein out of range');}\r
{i've seen the out of range case actually happening, so it can happen. test: just close the fd - beware}\r
if not assigned(currentsocket) then begin\r
{if not assigned(currentsocket) then raise exception.create('currentsocket not assigned');\r
if currentsocket.fdhandlein < 0 then raise exception.create('currentsocket.fdhandlein out of range');}\r
{i've seen the out of range case actually happening, so it can happen. test: just close the fd - beware}\r
if not assigned(currentsocket) then begin\r
- fdclose(dw shl 5 or bt);\r
continue\r
end;\r
if currentsocket.fdhandlein < 0 then begin\r
continue\r
end;\r
if currentsocket.fdhandlein < 0 then begin\r
- fdclose(dw shl 5 or bt);\r
- currentsocket.handlefdtrigger(fd_isset(currentsocket.fdhandlein,fdsr),fd_isset(currentsocket.fdhandleout,fdsw));\r
+ currentsocket.handlefdtrigger(fd_isset(fd,fdsr),fd_isset(fd,fdsw));\r
except\r
on E: exception do begin\r
currentsocket.HandleBackGroundException(e);\r
except\r
on E: exception do begin\r
currentsocket.HandleBackGroundException(e);\r
end;\r
end; *)\r
{ debugout('socketcount='+inttostr(socketcount));}\r
end;\r
end; *)\r
{ debugout('socketcount='+inttostr(socketcount));}\r
+ //writeln('leaving processasios');\r
end;\r
\r
procedure tselecteventcore.processmessages;\r
end;\r
\r
procedure tselecteventcore.processmessages;\r
\r
procedure tselecteventcore.rmasterset(fd : integer;islistensocket : boolean);\r
begin\r
\r
procedure tselecteventcore.rmasterset(fd : integer;islistensocket : boolean);\r
begin\r
+ //writeln('rmasterset called with fd ',fd);\r
if fd > absoloutemaxs then raise esocketexception.create('file discriptor out of range');\r
if fd > maxs then maxs := fd;\r
if fd_isset(fd,fdsrmaster) then exit;\r
if fd > absoloutemaxs then raise esocketexception.create('file discriptor out of range');\r
if fd > maxs then maxs := fd;\r
if fd_isset(fd,fdsrmaster) then exit;\r
\r
procedure tselecteventcore.rmasterclr(fd: integer);\r
begin\r
\r
procedure tselecteventcore.rmasterclr(fd: integer);\r
begin\r
+ //writeln('rmasterclr called with fd ',fd);\r
if not fd_isset(fd,fdsrmaster) then exit;\r
fd_clr(fd,fdsrmaster);\r
\r
if not fd_isset(fd,fdsrmaster) then exit;\r
fd_clr(fd,fdsrmaster);\r
\r
\r
procedure tselecteventcore.wmasterset(fd : integer);\r
begin\r
\r
procedure tselecteventcore.wmasterset(fd : integer);\r
begin\r
+ //writeln('wmasterset called with fd ',fd);\r
if fd > absoloutemaxs then raise esocketexception.create('file discriptor out of range');\r
if fd > maxs then maxs := fd;\r
\r
if fd > absoloutemaxs then raise esocketexception.create('file discriptor out of range');\r
if fd > maxs then maxs := fd;\r
\r
\r
procedure tselecteventcore.wmasterclr(fd: integer);\r
begin\r
\r
procedure tselecteventcore.wmasterclr(fd: integer);\r
begin\r
+ //writeln('wmasterclr called with fd ',fd);\r
if not fd_isset(fd,fdswmaster) then exit;\r
fd_clr(fd,fdswmaster);\r
end;\r
if not fd_isset(fd,fdswmaster) then exit;\r
fd_clr(fd,fdswmaster);\r
end;\r