Would it be possible to provide a variant that works on an existing connection instead of creating a new one?  I'm thinking it might be easier or cleaner in some cases to let the client create the connection and then make the decision about protocol later.