dns-2.0.10: DNS library in Haskell

Safe Haskell | None
Language | Haskell2010

Network.DNS.Decode

Synopsis

- decode :: ByteString -> Either String DNSMessage
- decodeMany :: ByteString -> Either String ([DNSMessage], ByteString)
- receive :: Socket -> IO DNSMessage
- receiveVC :: Socket -> IO DNSMessage

# Documentation

decode :: ByteString -> Either String DNSMessage #

Parsing DNS data.

decodeMany :: ByteString -> Either String ([DNSMessage], ByteString) #

Parse many length-encoded DNS records, for example, from TCP traffic.

receive :: Socket -> IO DNSMessage #

Receiving DNS data from `Socket` and parse it.

receiveVC :: Socket -> IO DNSMessage #

Receive and parse a single virtual-circuit (TCP) response. It is up to the caller to implement any desired timeout. This (and the other response decoding functions) may throw ParseError when the server response is incomplete or malformed.