CogServer

From OpenCog
Jump to: navigation, search

The CogServer implements a network and agent server. It provides shared network access to a given AtomSpace, together with some basic capabilities to open a database, load C++ modules and to run time-sliced processing "agents" called MindAgents.

The module system is somewhat deprecated: python and scheme users will typically find it more convenient to use the module system provided by those languages. Thus, there is no requirement that new C++ code must be wrapped into a CogServer module.

Future versions of the CogServer might remove the module subsystem.

The MindAgent subsystem is also somewhat obsolescent. It implements a crude single-threaded cooperative time-slicing framework. Most users will simply find it easier to just create a new thread to run whatever task that needs to be performed.

Future versions of the CogServer might remove the agent subsystem. Alternately, it might be useful to design a band-new thread management subsystem. Maybe. Unclear.

The most useful thing that the CogServer currently provides is shared multi-user network access to a command line, from which the python and scheme read-evaluate-print-loop (REPL) shells can be accessed. This allows users to perform management and development on an AtomSpace by attaching to it from a remote location. In particular, the AtomSpace(s) are not killed when the last user disconnects; the server will stay running in this dettached state, until user reconnect, or until it is shut down.

The network server is implemented by devoting one thread to listening for tcp/ip socket connections. Upon connection, a new thread is forked to handle user requests and the run the python/scheme shells. Command-line commands are implemented as "Requests", described below. The AtomSpace is thread-safe, as well as the Request queue, and the python/scheme REPL shells, so there should be no issues with multi-user access.