First, when we receive a new connection, we spawn off tasks to handle it, instead of doing it on the task accepting the connections. This allows us to talk to multiple clients at once, which is both required by the spec ("HAP accessory servers must support eight simultaneous TCP connections", page 52) and necessary for HAP to work correctly on networks with many Apple devices.
Moving things onto separate tasks caused some issues with making sure the EncryptedStream gets woken when necessary. I changed two try_read calls to use poll_read (which takes a context and ensures it gets woken), which fixed that.
Closes #37.
This does two things:
try_read
calls to usepoll_read
(which takes a context and ensures it gets woken), which fixed that.