separate socket factory and socket