UDPSocket sends short datagram using reinterpret

Is this a bug?

Common use case for UDPSocket: I have a struct that isbits. I want to msg = reinterpret(UInt8, [myobj]) and transmit this via a UDP datagram to be read on another Julia process, where I’ll just recv the datagram and reinterpret again.

Turns out if you send(socket, addr, port, msg), the datagram contains only 16 bytes while it should be 114 in my case.

I found out that if I collect(msg), then it works. So somehow send doesn’t break if given a view, but it’s not using the length for the full datagram.

I don’t know if it is a bug, but it is at least missing documentation send calls sizeof so msg must be isbits. I think you can use send(socket, addr, port, [myobj]) and get what you want.