Take host and port for agent from file.
general improvements in the protocol code