Implemented a Socket class