adding part of socket logic.