Class: Puma::MiniSSL::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/puma/minissl.rb

Overview

if defined?(JRUBY_VERSION) class Engine def self.server(key, cert) new(key, cert) end end end

Instance Method Summary collapse

Constructor Details

#initialize(socket, ctx) ⇒ Server

Returns a new instance of Server.



112
113
114
115
# File 'lib/puma/minissl.rb', line 112

def initialize(socket, ctx)
  @socket = socket
  @ctx = ctx
end

Instance Method Details

#acceptObject



121
122
123
124
125
126
# File 'lib/puma/minissl.rb', line 121

def accept
  io = @socket.accept
  engine = Engine.server @ctx.key, @ctx.cert

  Socket.new io, engine
end

#accept_nonblockObject



128
129
130
131
132
133
# File 'lib/puma/minissl.rb', line 128

def accept_nonblock
  io = @socket.accept_nonblock
  engine = Engine.server @ctx.key, @ctx.cert

  Socket.new io, engine
end

#closeObject



135
136
137
# File 'lib/puma/minissl.rb', line 135

def close
  @socket.close
end

#to_ioObject



117
118
119
# File 'lib/puma/minissl.rb', line 117

def to_io
  @socket
end