Class: RubyTls::Connection::Callback
- Inherits:
-
FFI::Function
- Object
- FFI::Function
- RubyTls::Connection::Callback
- Defined in:
- lib/ruby-tls/connection.rb
Class Method Summary collapse
-
.new(callbacks) ⇒ Object
Creates a new Parser callback.
Class Method Details
.new(callbacks) ⇒ Object
Creates a new Parser callback.
96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/ruby-tls/connection.rb', line 96 def self.new(callbacks) super(:void, [::RubyTls::State.ptr]) do |state| begin yield rescue => e # shutdown the connection on error # TODO:: Provide some debugging output callbacks[:close_cb].call state end end end |