License / Documentation home / Help and feedback |
By default, each Communicator server sets up a socket-based listener for the Hub to contact. As of version 2.1, it is possible to reverse the direction of this connectivity, by setting up listeners in the Hub instead. This has a number of clear advantages:
SERVICE_TYPE: parserWhen the Hub starts up, it will start a listener on port 15000 (or the next available port) and wait for connections. You can have as many or as few listeners as you want, and as many servers as you want can share a listener:
OPERATIONS: parse
CLIENT_PORT: 15000
SERVICE_TYPE: parserIn this example, the Hub will start up two listeners, one on port 15000 (shared by the parser and recognizer) and one on port 14000 (used exclusively by the database), and attempt to contact the generator on its own listener on port 18000. Listeners are shared based on the requested client port; so if port 15000 is taken, the Hub will start up a shared listener for the parser and recognizer on the next available port.
OPERATIONS: parse
CLIENT_PORT: 15000SERVICE_TYPE: recognizer
OPERATIONS: recognize
CLIENT_PORT: 15000SERVICE_TYPE: database
OPERATIONS: retrieve
CLIENT_PORT: 14000SERVER: generator
OPERATIONS: generate
HOST: localhost
PORT: 18000
Important: The Hub relies on the connecting server to identify itself by name in order to determine which of the server types to identify the new connection with. Therefore, unlike in normal server entries, the value of SERVER: or SERVICE_TYPE: must match the name the contacting server knows itself as.
% parser -contact_hub "localhost:15000"If the server in question is a UI element (say, an audio connection), you might want to associate it with a specific session:
% audio -contact_hub "localhost:2400" -session_id 20000711session1If you use the -session_id command line argument, it's equivalent to setting all the session lock flags for this server.
You can contact several Hubs at once:
% database -contact_hub "localhost:15000 remotehost:25000"The server will poll the connection location until it establishes a connection, and will start polling again when the Hub disconnects; it's possible to customize this behavior if you write your own main function.
License / Documentation home / Help and feedback |