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.



419
420
421
422
423
# File 'lib/puma/minissl.rb', line 419

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



446
447
448
# File 'lib/puma/minissl.rb', line 446

def addr
  @socket.addr
end

#to_ioObject (readonly)



440
441
442
# File 'lib/puma/minissl.rb', line 440

def to_io
  @socket
end

Instance Method Details

#acceptObject



425
426
427
428
429
430
# File 'lib/puma/minissl.rb', line 425

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

#accept_nonblockObject



432
433
434
435
436
437
# File 'lib/puma/minissl.rb', line 432

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

#closeObject



450
451
452
# File 'lib/puma/minissl.rb', line 450

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

#closed?Boolean

Returns:

  • (Boolean)


454
455
456
# File 'lib/puma/minissl.rb', line 454

def closed?
  @socket.closed?
end