[SOLVED]Problem with hxmpp lib

Hi all… I have an issue regarding the application (Android) I’m developing. I have clues on whats going on, but I am not sure. Since I am really new on Android dev and Openfl dev maybe you can help me with some guidance… I am using HXMPP lib which uses asynch sockets. Now lets suppose this basic app(in pseudocode)

class Application{

function init 
   u = new User();
   u.addEventListener(connected,onConnect)
   u.connect();

function onConnect
    DisplayMainInterface()
}

class User {
function connect
    x = new XMPPClient;
    x.addEventListener(xconnected,onXConn)
    x.connect();

function onXConn
    dispatchEvent(connected)
}

XMPP is the class that has the asynch socket. The application compiles and works. HXMPP lib works ok. It connects with the server and receives messages ok. All the events in my app are thrown and received ok but only a black screen are shown (i.e. No sprites are drawn on screen, however the method to display them starts and ends ok. ). However If I bypass all the connection process and I directly call the method for interface display. Screen are drawn ok. So, both behaviours acts ok separatedly but it fails when I run them together. I already know that Android has a “particular” way to handle the proceses and events… And I believe that this will be something related with this.
In short if someone knows what happens here, it will be great. If don’t, then if someone can point me to some doc or tutorial in where there is an explanation on how the lime/openfl interacts with droid system (in term of intents/Activities,etc) It will be of great help also. If don’t any other ideas on how to solve this are welcome. and If don’t have a nice weekend!!, leave the computer and enjoy today is saturday!!! :smiley:

regards
Luis

Working now!!! The problem was when reading, the socket hangs all other process. Have to create a new socket implementation using threading, and seems to be working ok. BTW… I loved the way that Haxe works with Threads!!! Clean and easy…

So if anyone has problems with this library just drop me a line and If it’s in my possibilities I will help

Best regards
Luis

Was this using an OpenFL socket or a Haxe socket? We should thread the OpenFL one if it is not already :slight_smile:

I use Haxe Socket.However If not already done implement one in Openfl would be great Specially for multiplayer games. I have to make a walkaround, to make it work, assing the final read of data inside an enter frame of a sprite, which works great but is not very “purist”.
So you can place it in the todo improvements it would be great!!

Thanks for your response.
Luis