Struct resolve::socket::DnsSocket [] [src]

pub struct DnsSocket { /* fields omitted */ }

Represents a socket transmitting DNS messages.

Methods

impl DnsSocket
[src]

[src]

Returns a DnsSocket, bound to an unspecified address.

[src]

Returns a DnsSocket, bound to the given address.

[src]

Returns a reference to the wrapped UdpSocket.

[src]

Sends a message to the given address.

[src]

Receives a message, returning the address of the sender. The given buffer is used to store and parse message data.

The buffer should be exactly MESSAGE_LIMIT bytes in length.

[src]

Attempts to read a DNS message. The message will only be decoded if the remote address matches addr. If a packet is received from a non-matching address, the message is not decoded and Ok(None) is returned.

The buffer should be exactly MESSAGE_LIMIT bytes in length.