SocketProxyAgent is a JADE agent that can be executed to communicate with remote clients via a socket.
Starting the SocketProxyAgent
It is a JADE agent itself and, therefore, must be launched within a JADE container with the following command:
java jade.Boot spa:jade.tools.SocketProxyAgent.SocketProxyAgent
At the startup, the agent searchs for a file that contains its initialization parameters.
The file must be named <agentname>.inf and must be put in the current working directory.
The first line in this file must contain the port number to which the agent listens for connections (put 0 for the default port number, i.e. 6789).
The second line in the file must contain the list P of agent names that wish this proxy agent to forward messages to them. All names must be on the same single line and must be separated by a blank.
The agent accepts up to 50 parallel connections.
Each message that arrives through the socket, is parsed, the destination agent is checked against the list P of agent names, and, eventually, forwarded to the destination agent. Each answer from the destination agent, is forwarded back through the socket again.