Hi,
I have a problem to get my asynchstream initialized.
My app connects nicely to a windows server when I use:
However, I get a crash when I use:
Error: java.lang.ArrayIndexOutOfBondsException: Offset out of bonds: -1
What am I doing wrong?
Thanks,
Johannes
I have a problem to get my asynchstream initialized.
My app connects nicely to a windows server when I use:
B4X:
AStreams.[COLOR="Red"]Initialize[/COLOR](ClientSocket.InputStream, ClientSocket.OutputStream, "AStreamsIn")
However, I get a crash when I use:
B4X:
AStreams.[COLOR="Red"]InitializePrefix[/COLOR](ClientSocket.InputStream, False, ClientSocket.OutputStream, "AStreamsIn")
B4X:
Sub Process_Globals
Dim ClientSocket As Socket
Dim AStreams As AsyncStreams
End Sub
Sub cmdConnect_Click
If Not(ClientSocket.IsInitialized) Then
ClientSocket.Initialize("ClientSocket")
End If
ClientSocket.Connect(sIP, iPort, 2000)
End Sub
Sub ClientSocket_Connected (Successful As Boolean)
If Successful Then
AStreams.InitializePrefix(ClientSocket.InputStream, False, ClientSocket.OutputStream, "AStreamsIn")
Else
ClientSocket.Close
End If
End Sub
What am I doing wrong?
Thanks,
Johannes