Class: Puma::MiniSSL::Server

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

Instance Method Summary collapse

Constructor Details

#initialize(socket, ctx) ⇒ Server

Returns a new instance of Server.


248
249
250
251
# File 'lib/puma/minissl.rb', line 248

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

Instance Method Details

#acceptObject


257
258
259
260
261
262
263
# File 'lib/puma/minissl.rb', line 257

def accept
  @ctx.check
  io = @socket.accept
  engine = Engine.server @ctx

  Socket.new io, engine
end

#accept_nonblockObject


265
266
267
268
269
270
271
# File 'lib/puma/minissl.rb', line 265

def accept_nonblock
  @ctx.check
  io = @socket.accept_nonblock
  engine = Engine.server @ctx

  Socket.new io, engine
end

#closeObject


273
274
275
# File 'lib/puma/minissl.rb', line 273

def close
  @socket.close unless @socket.closed?       # closed? call is for Windows
end

#to_ioObject


253
254
255
# File 'lib/puma/minissl.rb', line 253

def to_io
  @socket
end