B4R Question UPD packed send checking

mtd

Member
Helllo;
I used this code for data send with UDP protocol.

its work and i recive data with host.
But I closed Host application, and sender code result not change same read logs ("packet send")
How can i check send status?


Wemos board code:
B4X:
If udp.BeginPacket(sip,54321) Then
        udp.Write("Returns-")
        Dim x As String
        x=Rnd(100,999)
        Log(x)
        udp.Write(x)
        If udp.SendPacket Then
            Log("packet send")
        Else
            Log("Error")
        End If
    Else
        Log("Service Problems")
    End If
 

Erel

Administrator
Staff member
Licensed User
There isn't any other information available. You never know with UDP whether the sent packet was received (it is a connectionless protocol).
 

tigrot

Well-Known Member
Licensed User
I never use UDP, TCP is better, generates more traffic, but it's a lot safer. I connect, send info and if no other activity is needed, sconnect. Protocolo takes care of anything.
 
Top