B4J Question WebSockets and emulators

LucaMs

Expert
Licensed User
Longtime User
My first steps with WebSockets.

I have tried to start developing my "game architecture" :( using WebSocket Client Library as basic.

First step, first snag.

My "draft" works using a PC as server and my smartphone as client. It does not work using an emulator. The example WebSocket Client Library works in both cases.

(Note: My draft works using my smartphone, but I don't like it; it remember me the "spaghetti programming". So, I should ask how RunFunctionWithResult works, thinking that I could use it, but I'm hearing: "Please start a new thread for this question." ;))


Thank you in advance
 

Attachments

  • GameServer.zip
    1.4 KB · Views: 348
  • GameClient.zip
    13.1 KB · Views: 348

LucaMs

Expert
Licensed User
Longtime User
I recommend you to avoid using the emulator at all. Use a real device instead.

Yes, I know, and I agree, but when you have time (ie never :)) could you compare the two projects? They are almost identical and, tested on the same emulator, your project works well, mine not!

Also, I would need to run tests with 6 devices!

ws.RunFunction runs a JavaScript function (usually a void function).
ws.RunFunctionWithResult runs a JavaScript function and returns the function result as a Future object.

Yes, I had understood that difference, but the code "waits" for the result?
In addition, the Future object is a mystery :)


uhm what can I say, now? Damn memory... Oh, yes... THANK YOU, EREL
 
Upvote 0
Top