1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

B4R Question UPD packed send checking

Discussion in 'B4R Questions' started by mtd, Apr 19, 2019.

  1. mtd

    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:
    Code:
    If udp.BeginPacket(sip,54321Then
            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
     
  2. Erel

    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).
     
  3. mtd

    mtd Member

    Ok. thank you.
    UDP is one way ticket :)
     
  4. tigrot

    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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice