using inheritance for sockets