Skip to content

Conversation

@darkdragon-001
Copy link
Contributor

This makes it much more convenient to create servers. See diff to #1246 for examples/ddns_server.py.

Based on #1246

@rthalley
Copy link
Owner

I'm pretty sure I don't want it in the official API, but dnspython already has a more capable nameserver skeleton in tests/nanonameserver.py. Also, if we did export a server framework, then any async code should also support trio.

I'm skeptical of the utility of a generic server in the API, as my experience writing servers with dnspython is that the needs of real servers far exceed what any skeleton would provide. Taking something like nanonameserver as a basis for a server is certainly viable, but it's more of a starting point for edits than it is a proper API.

@darkdragon-001 darkdragon-001 force-pushed the async-server branch 3 times, most recently from 1489e2c to a326b46 Compare January 1, 2026 17:19
Adjust the default values of the DDNS client example to connect to the one from the server example.
The previous datagram socket for client use only allowed receiving a single message before it has been read (implementation via future).
For server use cases we would like to receive messages continuously.
This commit implements a dummy socket embedding received data such that dns.asyncquery.receive_udp() can still be used to read the message
in order to keep the interface as close as possible to the TCP implementation.
Also implementing a proper server class as public interface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants