Android Question (Wait For) wait only x second , if no response exit.

Drops

New Member
Hello, I need help with my problem. I can use (waitfor) to udp packet received, if packet no received for ex.10 second then close (waitfor) and continue program.

Wait For:
Wait For EventName_PacketArrived (Packet As UDPPacket)
 

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
Maybe something like this

B4X:
UDPTimeout
Wait For EventName_PacketArrived (Packet As UDPPacket)
        
If Not(Packet=Null) Then
        Log("packet arrived")
   Else
        Log("timeout")
End If

Sub UDPTimeout
    Sleep(10000)
    CallSubDelayed2(Me,"EventName_PacketArrived",Null)
End Sub
 
Upvote 0
Top