Made a per-connection instance version of the socket stream function.