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.



120
121
122
123
# File 'lib/puma/minissl.rb', line 120

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

Instance Method Details

#acceptObject



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

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

  Socket.new io, engine
end

#accept_nonblockObject



136
137
138
139
140
141
# File 'lib/puma/minissl.rb', line 136

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

  Socket.new io, engine
end

#closeObject



143
144
145
# File 'lib/puma/minissl.rb', line 143

def close
  @socket.close
end

#to_ioObject



125
126
127
# File 'lib/puma/minissl.rb', line 125

def to_io
  @socket
end