iOS Question Server/Socket comms and application_foreground

chrisinky

Member
Licensed User
Longtime User
Hi all,

First off B4i is amazing, I was able to port my B4a app so easily it wasn't funny...

I'm doing text client/server comms using asyncstreams and the app works great. However, if I hit the home button, or if I power off/back on the i device my app is hung, it's lost its communications. I added the following code to application_foreground and it will now at least function, but it most of the time crashes the first time after re-running the app, then it starts ok afterwards.... Any clue what I'm messing up?

<code>
Socket1.Initialize("Socket1")
Socket1.Connect(server_address,server_port,0)
Server.Initialize(server_port, "server")
Server.Listen

</code>
 
Top