public static ProcTransport Connect(Process proc)
{
proc.Start ();
if (proc.StandardOutput.ReadLine () != "AGNOS") {
throw new TransportException ("process " + proc + " did not start correctly");
}
string hostname = proc.StandardOutput.ReadLine ();
int port = Int16.Parse (proc.StandardOutput.ReadLine ());
ITransport transport = new SocketTransport (hostname, port);
return new ProcTransport (proc, transport);
}