module

LavinMQ::AcceptLoop

Accepts connections on a listener through errors that pass, instead of letting them stop the listener

Constants

CONNECTION_ERRORS = {Errno::ECONNABORTED, Errno::EPERM, Errno::EPROTO, Errno::ETIMEDOUT, Errno::ENOPROTOOPT, Errno::EOPNOTSUPP, Errno::ENETDOWN, Errno::ENETUNREACH, Errno::EHOSTUNREACH, Errno.new(112), Errno.new(64)}
Log = LavinMQ::Log.for("accept")
RETRY_DELAY = 10.milliseconds
RETRY_DELAY_MAX = 1.second

Class methods

each(server, name : String, &)

Yields each client accepted on server, a TCPServer or UNIXServer, until it's closed. After a connection error it accepts again right away. After any other error, like when out of file descriptors (EMFILE), retrying right away would only spin, so it retries with a growing delay.

Source