working on socket stream