I copied a class from B4J across to B4A that initialises a Socket (from Network lib) following a Sleep() function. The Socket works OK, but it's parentage was lost.
That is, it fires a "Connected" event back into "Main" not the class that contains the Socket.
I have attached a simple B4A example demonstrating this bug.
By the way, it works fine with the Sleep() function in B4J.
Confirmed. It is related to the class being initialized from the activity. (It is better to initialize a class that deals with network from the starter service to avoid the parent activity from being paused).
I understand the benifit of Starter service for sockets. Just thought the class would migrate to B4A without functional changes.
NB: When my class was in B4J, I introduced the Sleep() into the class just prior to initialising the SOCKET, to overcome the problem in B4J where if the SOCKET was initialised in the sub Initialize, of the class, then it would neven connect to anything, without any errors.