class

Via::TLS::ReloadableServer

Inherits Socket::Server < Reference < Object

Constructors

new(host : String, port : Int32, state : Runtime::State)
Source

Instance methods

accept

Accepts an incoming connection and returns the client socket.

require "socket"

server = TCPServer.new(2202)
while true
  socket = server.accept
  socket.puts Time.utc
  socket.close
end

If the server is closed after invoking this method, an IO::Error (closed stream) exception must be raised.

Source
accept?

Accepts an incoming connection and returns the client socket.

Returns nil if the server is closed after invoking this method.

require "socket"

server = TCPServer.new(2202)
while socket = server.accept?
  socket.puts Time.utc
  socket.close
end
Source
close
Source
local_address