Event-Handling need improvement
Status: Beta
Brought to you by:
tawerner
When the client is performing a (long) task on the
server (i.e. connecting without getting a reply ->
timeout), no other events get carried out (such as
Hang-up or Exit).
Try hitting "Exit" while connecting to a non-existing
host or while refreshing Status... Nothing happens!
Logged In: YES
user_id=594089
This is due to the nature of the used
Winsock-abstraction-library. While performing a server-task
(i.e. connecting), the code executes in a loop to wait for
response from the server. To make the waiting non-blocking,
on every loop-pass a "DoEvents" is executed.
If you would now click on a button (perhaps the
"Options"-Button), the Dialog would appear. This "event"
ends just when the Dialog is closed again. And THEN the
server-loop gets executed again.
So, the user could block the whole server-communication.
Therefore, I disabled the buttons, while any
server-communication takes place.
Solution: perhaps use some kind of queueing, i.e. instead of
discarding the clicks, carry them out after the
communication has stopped.
This is still no "good" solution, I'd appreciate a better
way to do it.