ace v0.7.1 Ace.TCP.Endpoint

Starting the combination of socket, governors and server supervisor.

Endpoints are started with a fixed pool of governors under the Ace.TCP.Governor.Supervisor. The number of governors is equal to the maximum number of servers that can be accepting new connections.

An endpoint is configured by the options passed to start_link/2.

Summary

Types

Reference to the endpoint

Option values used to start an endpoint

Configuration options used when starting and endpoint

Functions

Retrieve the port number for an endpoint

Start a new endpoint with the app behaviour

Types

endpoint()
endpoint :: pid

Reference to the endpoint.

option()
option ::
  {:name, GenServer.name} |
  {:acceptors, non_neg_integer} |
  {:port, :inet.port_number}

Option values used to start an endpoint.

options()

Configuration options used when starting and endpoint.

Functions

port(endpoint)
port(endpoint) :: {:ok, :inet.port_number}

Retrieve the port number for an endpoint.

start_link(app, options)
start_link(app, options) :: {:ok, endpoint} when app: Ace.TCP.Server.app

Start a new endpoint with the app behaviour.

Options

  • :port - the port to run the server on. Defaults to port 8080.

  • :name - name to register the spawned endpoint under. The supported values are the same as GenServers.

  • :acceptors - The number of servers simultaneously waiting for a connection. Defaults to 50.