-
Notifications
You must be signed in to change notification settings - Fork 188
Closed
Milestone
Description
TCPSocket.open is a thing, but there is no equivalent to SSLSocket.open.
This becomes a tricky problem to work around, often requiring overloading in #initialize to handle the different cases. The main cases are:
Make a new socket and connect to this hostname (should be .open).
Make a new socket with the given file descriptor or some other specific situation (should be .new).
This issue becomes a problem when making wrappers. Because in your own #initialize you need to detect the intent of the user. I'm not sure if there is an alternative or not.
So, ideally, we simply add an alias SSLSocket.open is identical to SSLSocket.new. But, for the purposes such as HTTP.rb, we expect that to use socket_class.open rather than socket_class.new.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels