Does agsXMPP use a single thread to raise all the events or is each callback a different event? I think you will need lock ()s for all access to shared state (class members).