Skip to content

SocketReactor while(1) CPU wasted #3773

@micheleselea

Description

@micheleselea

I think with 1.12.2 we revert to the old problem of socket reactor goes in "while(1)" if no socket is sending.
So for example I can reproduce the problem simply using telnet to connect to the server and while(1) starts.
That because it seems that
PollSet::SocketModeMap sm = _pollSet.poll(_timeout);
is not waiting for _timeout but it returns immediately with sm.size()==0 so onTimeout() is called. So I'm going to think if do a trySleep inside onTimeout() but I want to check why poll is not waiting for timeout, I'll keep you updated

ps.using windows 11 compiled with VisualStudio 2022 and using SocketReactor basically to handle FTP command (21 port) sockets

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions