iOS Question Astream not initializing

Scantech

Well-Known Member
Licensed User
Longtime User
Private Sub ConnectToServer(Host As String, PORT1 As Int)
Log("Trying to connect to: " & Host)
CloseExistingConnection

Dim client As Socket
client.Initialize("client")
client.Connect(Host, PORT1, 10000)

Wait For Client_Connected (Successful As Boolean)
If Successful Then
xui.Msgbox2Async("Connecting True", "", "OK", "", "", Null)

ClientConnected(True)
Else
xui.Msgbox2Async("Connecting False", "", "OK", "", "", Null)

ClientConnected(False)
End If
End Sub

The code above will connect succesfully.

Sub ClientConnected (Success As Boolean)
Try

If Success Then
client.TimeOut = 0

astream.Initialize(client.InputStream, client.OutputStream, "AStreams")

If astream.IsInitialized Then
lblStatus.Text = "Astream is ok"
End If

The ClientConnected method has a problem with astream not being initialized? Only with IOS. Android is working good. Any ideas??
 

hatzisn

Well-Known Member
Licensed User
Longtime User
I cannot be sure but have you tried to set #ATSEnabled: False in project attributes in Main? Try it and let us know.
 
Upvote 0

Scantech

Well-Known Member
Licensed User
Longtime User
Forgot to add s with Astream_Newdata event. Should be Astreams_Newdata. Its really hard to debug b4i while using OBD2 wifi.
 
Last edited:
Upvote 0
Top