Added function to get socket descriptor in socket classes