How do you flush the send buffer for a channel before disconnecting?

Asked by lyme on 2010-10-10

I've noticed that if I simply call ircClient.Disconnect(); immediately after calling ircClient.Channels.Leave(channel, "Bye"); the Bye message doesn't have enough time to hit the channel. Is there a way to flush the send queue before disconnecting?

Question information

Language:
English Edit question
Status:
Solved
For:
IRC.NET Edit question
Assignee:
Alexander Regueiro Edit question
Solved by:
Alexander Regueiro
Solved:
2010-10-10
Last query:
2010-10-10
Last reply:
2010-10-10
Best Alexander Regueiro (alexreg) said : #1

You're right, this is a slight problem at the moment. It is due to the way the client handles the write stream, which is managed by a separate thread, and thus is not always flushed immediately. The 0.4 release will change the underlying network I/O architecture significantly such that this will no longer be a problem. Until then, I recommend you create a simple timeout mechanism using ThreadPool or such.

lyme (lyme) said : #2

Sounds good for 0.3, thanks for the info.

lyme (lyme) said : #3

Thanks Noldorin, that solved my question.