reworked to allow for only 1 out/in stream per socket