Mrphone
Member
hi
I'm created a program that connects to a Wi-Fi using the "network" library , Everything works fine, but when the mobile screen turns off, the connection is lost
What should be done so that when the mobile screen is turned off, the connection is still in place and not disconnected?
I'm created a program that connects to a Wi-Fi using the "network" library , Everything works fine, but when the mobile screen turns off, the connection is lost
What should be done so that when the mobile screen is turned off, the connection is still in place and not disconnected?
Code:
#Region Service Attributes
#StartAtBoot: true
#End Region
Sub Process_Globals
Dim WiFi_Socket As Socket
Dim TcpStreams As AsyncStreams
Dim ServerSocket1 As ServerSocket
Dim ServerIp As String = "192.168.4.1" 'IP Access point
Dim Port As Int = 80 'port
End Sub
Sub Service_Start (StartingIntent As Intent)
WiFi_Socket.Initialize("WiFi_Socket")
WiFi_Socket.Connect(ServerIp,Port,0)
ServerSocket1.Initialize(0,"")
End Sub
Sub WiFi_Socket_Connected (Connected As Boolean)
If Connected = True Then
'connected'
TcpStreams.Initialize(WiFi_Socket.InputStream,WiFi_Socket.OutputStream,"tcpStreams")
Else
'disconnected'
End If
End Sub
Sub TcpStreams_NewData (Buffer() As Byte)
.
.
.
End Sub
Sub Service_Destroy
End Sub