Socket Class Implementation