Reorganizing socket operations. From now on only ILogicalServer is responsible for parsing streams and replying.