Giter Club home page Giter Club logo

acceptor's Introduction

#Acceptor - TCP Listener and Connection Distributor

This daemon will listen for connections on a TCP port and distribute them to other processes. This can be used to allow non-root processes to bind privileged ports. Acceptor enables servers to scale using processes while still binding a single port (and no forking required).

#Example

Start Acceptor. Specify the port it should listen on. Specify a name for the Unix socket used to send TCP connections to other daemons.

./acceptor --port=10000 --name=acceptorTest

Start a daemon process which receives connections from acceptor, for example the included 'tester' app.

./tester --name=acceptorTest --message=SomeTestMessage

Now acceptor will pass new connections to 'tester', which will send the string "SomeTestMessage" to the client. Start a telnet session:

telnet localhost 10000
SomeTestMessage

Add another 'tester' app to have acceptor split connections between both processes:

./tester --name=acceptorTest --message=SomeOtherMessage

Start telnet sessions, watch the different messages:

telnet localhost 10000
SomeTestMessage
telnet localhost 10000
SomeOtherMessage

#Usage

--help          produce help message
--name or -n    name of the UNIX socket to bind
--host or -h    default: localhost. host to listen for tcp connections on
--port or -p    port to listen for tcp connections on
--listenBacklog or -l default: 5. backlog parameter passed to listen()

#TODO

-better load balancing (currently only supports round-robin) -possibly allow connection receivers to send messages to acceptor (keep alive, indicate how loaded they are) -mechanism for client connections to specify which backend they'd like to be passed to? routing?

#License

Public domain

acceptor's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.