Dim UDPSocket1 As UDPSocket
Dim BonjourAutoDiscovery As UDPSocket
UDPSocket1.Initialize("UDP", 0, 8000)
BonjourAutoDiscovery.Initialize("BonjourAutoDiscovery",5353 , 8192)
Sub Bonjour '(Working)
Dim Packet As UDPPacket
Dim data() As Byte
data = b.HexToBytes("000000000001000000000000085F73646C65645631045f746370056c6f63616c00000c0001")
Packet.Initialize(data, "224.0.0.251", 5353)
UDPSocket1.Send(Packet)
End Sub
Sub BonjourAutoDiscovery_PacketArrived (Packet As UDPPacket) '(Not working)
Log(Packet.HostAddress)
Dim msg As String
msg = BytesToString(Packet.Data, Packet.Offset, Packet.Length, "UTF8")
msg = b.StringFromBytes(Packet.Data, "UTF8")
Log(msg)
Msgbox("Message received: " & msg, "")
'Code to analyze the answer...
End Sub