Dns Codec updated pull request

I had already closed the other pull request and deleted the repository. I don't think I can reopen pull requests. But here is an updated one (with some changes to work with 4.0.2).

I noticed when writing to a channel information isn't flushed automatically, I have to use writeAndFlush(). Intentional?