Socket code added