poco icon indicating copy to clipboard operation
poco copied to clipboard

SocketReactor: Remove not useful handlers calls

Open aleks-f opened this issue 2 years ago • 5 comments

There are handler calls in the SocketReactor::run() that are of no use (onIdle()), or little use (onBusy()).

These calls will be removed from SocketReactor::run(). Subscribers to these events will have to overide the run() function to keep the functionality.

aleks-f avatar Jul 20 '22 09:07 aleks-f

onIdle and onBusy handlers, can be usefull to handle a dead socket, for example a socket that do not send you nothing for X seconds. That was the main reason I use it now

micheleselea avatar Aug 23 '22 10:08 micheleselea

Agreed with @micheleselea . One need a way to smoothly cleanup the socket space otherwise, one could get an exhaust exception

zosrothko avatar Aug 23 '22 10:08 zosrothko

I'm not following, onIdle() was called when there are no socket handlers - who's there to handle the idle notification?

When there are registered handlers but no activity, there is timeout notification:

https://github.com/pocoproject/poco/blob/5c3f827c8639a996dd0d27a77f48d343ed6fe524/Net/include/Poco/Net/SocketReactor.h#L88-L92

aleks-f avatar Aug 23 '22 11:08 aleks-f

In any case, SocketReactor is a Runnable, which means user can override the run() to do whatever necessary for their requirements - we can't be all things to all people.

aleks-f avatar Aug 23 '22 11:08 aleks-f

yes @aleks-f you are right, it's onBusy that do the "socket checker" in my project and I already had to extend the SocketReacor

micheleselea avatar Aug 23 '22 11:08 micheleselea

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Aug 24 '23 02:08 github-actions[bot]

This issue was closed because it has been inactive for 60 days since being marked as stale.

github-actions[bot] avatar Oct 23 '23 02:10 github-actions[bot]