FakeRiak.Listener (fake_riak v0.1.0)

Copy Markdown View Source

A supervised TCP acceptor for a single protocol.

On start it opens a listening socket on the configured port and spawns an accept loop. Every accepted connection is handed to an unlinked process running FakeRiak.Connection.serve/2 with the configured handler module, so a misbehaving client can never take down the acceptor.

Options:

  • :name — registered name / logging label (usually the handler module)
  • :port — TCP port to listen on (0 lets the OS pick a free port)
  • :handler — module implementing FakeRiak.Protocol
  • :ip — interface address to bind (defaults to 127.0.0.1)

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns the actual port the listener is bound to (useful with port 0).

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

port(server)

Returns the actual port the listener is bound to (useful with port 0).

start_link(opts)