I worry about the overhead of creating the socket with each function call. If this is a performance issue in the wild, we could certainly tackle it as a follow-up.