How can I create a two-way SSL socket in Ruby
问题 I am building a client Ruby library that connects to a server and waits for data, but also allows users to send data by calling a method. The mechanism I use is to have a class that initializes a socket pair, like so: def initialize @pipe_r, @pipe_w = Socket.pair(:UNIX, :STREAM, 0) end The method that I allow developers to call to send data to the server looks like this: def send(data) @pipe_w.write(data) @pipe_w.flush end Then I have a loop in a separate thread, where I select from a socket