abort connections before shutting them down
delete events before closing the socket
correctly generate Content-Range headers
close the connection on shutdown when the output stream is empty