Implemented basic socket functionality