Async::DNS SourceAsyncDNS

module DNS

Nested

Definitions

def self.chunked(string, chunk_size = 255)

Produces an array of arrays of binary data with each sub-array a maximum of chunk_size bytes.

Implementation

def self.chunked(string, chunk_size = 255)
	chunks = []
	
	offset = 0
	while offset < string.bytesize
		chunks << string.byteslice(offset, chunk_size)
		offset += chunk_size
	end
	
	return chunks
end

UDP_REASONABLE_SIZE = 512

The maximum size of a normal DNS packet (excluding EDNS).

UDP_MAXIMUM_SIZE = 2**16

The maximum size of a UDP packet.