I have this code in vb.net.
Connect perfectly!
I tried this on b4a
Does not work
Connect perfectly!
B4X:
Public Shared Sub Send(ByVal msg As String)
Try
Using MS As New MemoryStream
Dim B As Byte() = SB(msg)
Dim L As Byte() = SB(B.Length & CChar(vbNullChar))
MS.Write(L, 0, L.Length)
MS.Write(B, 0, B.Length)
S.Poll(-1, SelectMode.SelectWrite)
S.Send(MS.ToArray, 0, MS.Length, SocketFlags.None)
End Using
Catch ex As Exception
isDisconnected()
End Try
End Sub
I tried this on b4a
B4X:
If socket1.Connected = True Then
Dim xStringBytes() As Byte = xEnvio.GetBytes("UTF8")
If astream.IsInitialized Then
astream.Write(xStringBytes)
End If
End If
Does not work