I'm using astreams to connect to a server written in VB6.
Everything works great. But when I leave the phone alone for 15 min or so. The connection gets terminated.
On the VB6 server program The winsock_error routine gets fired.
But no "AStreams_Terminated" on the app.
As I thought is is the wlan connection on the phone that is going idle
I tried using both
WS.KeepAlive(True)
WS.PartialLock
from the PhoneWakeState
Sub AStreams_error
'// verbindinig is verbroken. Nieuwe verbinding proberen te maken.
Tmr.Initialize("Tmr1",3000) '/ seconden wachten (wait)
Tmr.Enabled = True
ToastMessageShow("Opniew verbinden .. ",True)
End Sub
Sub Tmr1_Tick
'// reconnecting
Socket1.Initialize("Socket1") '// <-- dit moet
Socket1.Connect(Var_ServerIp,Var_ServerPoort,1001)
Tmr.Enabled = False
ToastMessageShow("Opniew verbinden .. ",True)
End Sub
ok. if you use your communication in services, the problem is that the wifi goto sleep (erel is right).
You can use the solution from the "erel-link" or go to the settings of the phone and change the wifi state to "never go sleep".