i see global warming has reached your part of the world (hum 200, temp 320). almost as hot as here.
your code is more or less correct. what i don't see is where you initialize your udp socket. also you
need to take into account the size of the data buffer. also, it's risky to name your variables the way you
do ("dim int() as int"). also, never use toast as a debugging tool. use the log.
anyway, i retrofitted a little broadcast routine i have to accomodate your int array. i send this way:
Dim hum=200,temp=320 As Int
Dim intarray() As Int = Array As Int(temp,hum)
Dim data() As Byte = bc.IntsToBytes(intarray)
Log("data size: " & data.Length)
udp.Initialize("udp", 0, data.length)
Packet.Initialize(data, broadcast, 51049)
Log("sending...")
udp.Send(Packet)
on the receiving end, it receives thus:
' don't forget to initialize the receiving socket with the same size buffer
Log("pkt rcvd." & P.Data.Length & " bytes")
Dim mydata() As Int = bc.IntsFromBytes(P.Data)
Dim i As Int
For i = 0 To mydata.Length - 1
Log(mydata(i))
Next
Log("done with this packet")
and in the receiver's log:
broadcast: 192.168.12.255
pkt rcvd.8 bytes
320
200
done with this packet