Data exchange through socket