int GetPort () { int port; ushort p; if (UInt16.TryParse (host_port.Value, out p)) port = p; else port = -1; return port; }