send package:dns

Send an encoded DNSMessage datagram over UDP. The message length is implicit in the size of the UDP datagram. With TCP you must use sendVC, because TCP does not have message boundaries, and each message needs to be prepended with an explicit length. The socket must be explicitly connected to the destination nameserver.
Send one or more encoded DNSMessage buffers over TCP, each allready encapsulated with an explicit length prefix (perhaps via encodeVC) and then concatenated into a single buffer. DO NOT use sendAll with UDP.
Send an encoded DNSMessage datagram over UDP to a given address. The message length is implicit in the size of the UDP datagram. With TCP you must use sendVC, because TCP does not have message boundaries, and each message needs to be prepended with an explicit length.
Send a single encoded DNSMessage over TCP. An explicit length is prepended to the encoded buffer before transmission. If you want to send a batch of multiple encoded messages back-to-back over a single TCP connection, and then loop to collect the results, use encodeVC to prefix each message with a length, and then use sendAll to send a concatenated batch of the resulting encapsulated messages.