End of stream sent before connection close

Encoders need to send the appropriate end-of-stream signal before a TCP connection is closed.

Encoders that fail to properly send the end of stream will orphan the stream, leaving it in an unusable state and negating future attempts to use the same stream name and ID.