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.



465
466
467
468
469
# File 'lib/puma/minissl.rb', line 465

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

Instance Attribute Details

#addr ⇒ Object (readonly)

Version:

  • 5.0.0



492
493
494
# File 'lib/puma/minissl.rb', line 492

def addr
  @socket.addr
end

#to_io ⇒ Object (readonly)



486
487
488
# File 'lib/puma/minissl.rb', line 486

def to_io
  @socket
end

Instance Method Details

#accept ⇒ Object



471
472
473
474
475
476
# File 'lib/puma/minissl.rb', line 471

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

#accept_nonblock ⇒ Object



478
479
480
481
482
483
# File 'lib/puma/minissl.rb', line 478

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

#close ⇒ Object



496
497
498
# File 'lib/puma/minissl.rb', line 496

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

#closed? ⇒ Boolean

Returns:

  • (Boolean)


500
501
502
# File 'lib/puma/minissl.rb', line 500

def closed?
  @socket.closed?
end