The dcstream has been updated to watch for finish events when writing and now sends an '::endofstream` message over the data channel to indicate that a stream has finished writing. When we receive this event we then emit the 'end' event.
This functionality needs some tests.