Android Question Async Socket does not read all data

jamarquezw

Member
Licensed User
Longtime User
Hi. I am reading a socket, if the socket data is small (1000 bytes) it works fien, if th socket size is larger (6000 bytes) it does not read al the socket's data.
my code is
Sub EnviarMensaje(mensaje As String)
Smensaje=mensaje
If socketclose==False Then
sockete.Close
'AStreams.Close
End If
socketclose=False
sockete.Initialize("sockete")
sockete.Connect(Sip,Spuerto,8000)
End Sub

'prueba con sokets
Sub AStreams_Error
ToastMessageShow(LastException.Message, True)
End Sub

Sub AStreams_NewData (buffer() As Byte)
Dim bf As Int
Dim msg As String=""
Dim lm As Int
msg = BytesToString(buffer, 0, buffer.Length,"UTF8")
Msgbox(msg,"ok")
'Mgbox(msg,"Retorno")

bf=buffer.Length
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…