Hi, i already did a post on UDP, where Erel suggest me to do a simper project (i copied the one in the guide) but i doensn't work
I send a packet when pressing a button, my server always respond with another packet saying "OK", the problem is that the sub "PacketArrived" fires only the first time, if i send another packet, it arrives to the server, it respond, but nothing fires in b4i...
this is the code:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
Thanks in advance
			
			I send a packet when pressing a button, my server always respond with another packet saying "OK", the problem is that the sub "PacketArrived" fires only the first time, if i send another packet, it arrives to the server, it respond, but nothing fires in b4i...
this is the code:
			
				B4X:
			
		
		
		Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
    Public App As Application
    Public NavControl As NavigationController
    Private Page1 As Page
    Dim UDPSocket1 As UDPSocket
    Private btnSend As Button
    Private txt1 As TextField
End Sub
Private Sub Application_Start (Nav As NavigationController)
    'SetDebugAutoFlushLogs(True) 'Uncomment if program crashes before all logs are printed.
    NavControl = Nav
    Page1.Initialize("Page1")
    Page1.Title = "Page 1"
    Page1.RootPanel.LoadLayout("1")
    NavControl.ShowPage(Page1)
    
    UDPSocket1.Initialize("UDP", 0, 8000)
End Sub
Sub UDP_PacketArrived (Packet As UDPPacket)
    Dim msg As String
    msg = BytesToString(Packet.Data, Packet.Offset, Packet.Length, "UTF8")
    Msgbox("Message received: " & msg, "")
End Sub
Sub btnSend_Click
    Dim Packet As UDPPacket
    Dim data() As Byte
    data = txt1.Text.GetBytes("UTF8")
    Packet.Initialize(data, "--.---.--.---", -----)
    UDPSocket1.Send(Packet)
End SubThanks in advance
 
				 
 
		 
 
		 
 
		 
 
		 
 
		