Menu

#3 Asynchronous logon process

open
nobody
None
5
2005-01-21
2005-01-21
No

This patch makes the logon process asynchronous. You
need to apply this patch after patch #1106873. You
might also choose to apply only this patch (and replace
getSessionStatus() with sessionStatus) and it might
work in some platforms, but I don't recommend that.

The advantages are great for server side usage of the
library, as it prevents blocking on logon. In fact, it
prevents a nasty deadlock caused by the aformentioned
side patch, due to synchronized blocks being used
carelessly and covering too much code.

By the way, blocking would be ok in some circumstances,
but the way it was implemented (polling continuously
after a 10 ms sleep) really hurts when using many
simultaneous instances of the library.

I added two methods to the listener, and there are no
regressions that I'm aware of. I also removed two
unnecessary state fields from Session, loginOver
(replaced by sessionStatus and changes in the code
flow) and loginException (made local to the single
place where it's used now).

Discussion

  • Javier Kohen

    Javier Kohen - 2005-01-21
     
  • Javier Kohen

    Javier Kohen - 2005-03-21

    Logged In: YES
    user_id=68628

    I will soon update this patch for version 0.6 of the
    library. The new patch includes a similar change for the
    chat code.

     

Log in to post a comment.