Class: Puma::MiniSSL::Server

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(socket, ctx) ⇒ Server

Returns a new instance of Server.


319
320
321
322
323
# File 'lib/puma/minissl.rb', line 319

def initialize(socket, ctx)
  @socket = socket
  @ctx = ctx
  @eng_ctx = IS_JRUBY ? @ctx : SSLContext.new(ctx)
end

Instance Attribute Details

#addrObject (readonly)

Version:

  • 5.0.0


346
347
348
# File 'lib/puma/minissl.rb', line 346

def addr
  @socket.addr
end

#to_ioObject (readonly)


340
341
342
# File 'lib/puma/minissl.rb', line 340

def to_io
  @socket
end

Instance Method Details

#acceptObject


325
326
327
328
329
330
# File 'lib/puma/minissl.rb', line 325

def accept
  @ctx.check
  io = @socket.accept
  engine = Engine.server @eng_ctx
  Socket.new io, engine
end

#accept_nonblockObject


332
333
334
335
336
337
# File 'lib/puma/minissl.rb', line 332

def accept_nonblock
  @ctx.check
  io = @socket.accept_nonblock
  engine = Engine.server @eng_ctx
  Socket.new io, engine
end

#closeObject


350
351
352
# File 'lib/puma/minissl.rb', line 350

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

#closed?Boolean

Returns:

  • (Boolean)

354
355
356
# File 'lib/puma/minissl.rb', line 354

def closed?
  @socket.closed?
end