}
public static void main(String[] args) {
// create a new DisplayAgent
DisplayAgent agent = new DisplayAgent("localhost", 8336);
// register this class as listener
agent.addPacketListener(new ExampleDisplayAgent());
// get the status of NeuroServer
StatusReply statusReply = agent.getStatus();
// get the header of client 0
HeaderReply headerReply = agent.getHeader(0);
// get the role of this agent
RoleReply roleReply = agent.getRole();
// start watching client 0
agent.watch(0);
// stop watching client 0
agent.unwatch(0);
// close the agent and disconnect from NeuroServer.
agent.close();
}