socket partial implementation