I get this error message when sending data via UDP.
The port is opened with this:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
which does not cause a fault,
and the data is sent with this:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
Target IP is set to "255.255.255.255" (broadcast) and the port is 8899.
(I may add this code works under B4A)
Just found that a different method must be used to send broadcast packets, so I have changed the last line to:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
but I am still getting error 49, whether I send to the broadcast address or the actual IP address of the target.
This looks similar to this issue:
https://www.b4x.com/android/forum/t...-2-the-udp-send-data-error.74571/#post-473891
			
			The port is opened with this:
			
				B4X:
			
		
		
		UDPSck1.Initialize( "UDPSck1", Port, 4096 )
	and the data is sent with this:
			
				B4X:
			
		
		
		Public Buffer() As Byte
c = "Test"
Buffer = c.GetBytes( "UTF8" )
Dim Packet As UDPPacket
Packet.Initialize( Buffer, TargetIP, Port )
UDPSck1.Send( Packet )
	(I may add this code works under B4A)
Just found that a different method must be used to send broadcast packets, so I have changed the last line to:
			
				B4X:
			
		
		
		    If TargetIP = "255.255.255.255" Then
        UDPSck1.SendBroadcast( Packet )
    Else
        UDPSck1.Send( Packet )
    End If
	This looks similar to this issue:
https://www.b4x.com/android/forum/t...-2-the-udp-send-data-error.74571/#post-473891
			
				Last edited: