How about allowing `sock` to be any `IO::Socket` subclass; then the user could just pass whatever object they want and it will work.