working with socket