ecdavis / pants

A lightweight framework for writing asynchronous network applications in Python.
http://pantspowered.org/
Apache License 2.0
167 stars 9 forks source link

Datagram should switch to listening mode when data is written #28

Closed ecdavis closed 12 years ago

ecdavis commented 12 years ago

SOCK_DGRAM sockets automatically bind to a local address when data is written to them. Pants should alter its state to reflect this by setting _listening to True and updating events (if necessary) either directly before a call to sendto() or directly after. Not sure which.

stendec commented 12 years ago

It should happen directly after the call to sendto(). The binding happens within the sendto call if it isn't previously bound.

ecdavis commented 12 years ago

As far as I can tell, no event updates are necessary.