meebey / SmartIrc4net

IRC C# Library
http://www.meebey.net/projects/smartirc4net/
Other
126 stars 52 forks source link

Listen(true) not working #49

Closed johmarjac closed 6 years ago

johmarjac commented 6 years ago

Hi,

when I use Listen() overload it works fine, but as soon as I set blocking to false, no events are being fired, is that a bug?

Thanks in advance

meebey commented 6 years ago

This is more or less expected behavior, see: https://github.com/meebey/SmartIrc4net/blob/master/src/IrcConnection/IrcConnection.cs#L851

If you call Listen(false) it will only process one iteration of events, if there are any messages pending to be processed at the time of the call. If the receive queue is empty, it will simply return and do nothing.

johmarjac commented 6 years ago

Ah I thought this is kind of an overload for asynchronous behavior. Misunderstood that then.

Thanks for clearing that up.

meebey commented 6 years ago

You are welcome. The inline docs should describe the behavior really but currently it doesn't.