![]() In C, you can set the SO_RECVTIMEO option with setsockopt().īit Masking: If you need to check for the presence of a single bit or set a single bit in a larger integer field (with message compression), recall the bitwise operations you learned at the beginning of CS 31. Python makes this easy with the settimeout() socket method. Tell the OS that you don’t want to block indefinitely, otherwise you mightĭeadlock. ![]() Timeout on non-responsive Server: When waiting for a response (while blocked on recvfrom()), you’ll need to ![]() When you get an AAAA response, look to see if you got other answer records of type A. You don’t need to handle the first two in a special way, just print what you got and exit. You’re likely to also come across CNAME (in the case of a name alias), SOA (if you’re asked to resolve a name that doesn’t exist), and AAAA (IPv6 answer). Resource Record Types: In your queries, you can expect to encounter resource records of type A, MX, and NS. If your server times out, you can query the next server in your list of servers. Querying Servers: You only have to query one root server, and one TLD server. Duplicating code leads to more difficult debugging! You’ll have a much better time if you create one function, that you can call whenever necessary, to handle a task that comes up repeatedly. Structuring your code: You will find yourself using similar logic to parse many parts of a resource record. Interpreting the data that you’re sending and receiving. Wireshark for debugging: Since DNS is not a text-based protocol, Wireshark is a very useful tool for
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |