204 |
|
|
205 |
|
// start firewall if needed |
206 |
|
_server = handleFirewall(_configuredServer, port, _controlFirewallProcess); |
207 |
< |
|
207 |
> |
|
208 |
|
Conient.setControlStatus("Connecting to - " + _server); |
209 |
|
_controlLink = new Socket(_server, port); |
210 |
|
_inBound = new BufferedReader(new InputStreamReader(_controlLink.getInputStream())); |
621 |
|
* @param firewallProcess the holder for the new firewall process |
622 |
|
* @return the server to connect to, as determined by this routine |
623 |
|
*/ |
624 |
< |
private String handleFirewall(String server, int port, Process firewallProcess) { |
624 |
> |
private String handleFirewall(String server, int port, TunnelProcess firewallProcess) { |
625 |
|
String firewallCommand = _configuration.getProperty("firewall.command"); |
626 |
|
String useFirewall = _configuration.getProperty("useFirewall"); |
627 |
|
String firewallCommandWait = _configuration.getProperty("firewall.commandwait"); |
634 |
|
Conient.addMessage("WARNING{firewall}: firewall pipes requested, running pipe setup command \"" + firewallCommand + "\""); |
635 |
|
try { |
636 |
|
// run the command |
637 |
< |
firewallProcess = Runtime.getRuntime().exec(firewallCommand); |
637 |
> |
firewallProcess.setProcess(Runtime.getRuntime().exec(firewallCommand)); |
638 |
|
|
639 |
|
// work out how long we should wait before carrying on |
640 |
|
int time = 0; |
672 |
|
* |
673 |
|
* @param firewallProcess the process to check |
674 |
|
*/ |
675 |
< |
private void closeFirewall(Process firewallProcess) { |
676 |
< |
if (firewallProcess != null) { |
677 |
< |
firewallProcess.destroy(); |
678 |
< |
firewallProcess = null; |
675 |
> |
private void closeFirewall(TunnelProcess firewallProcess) { |
676 |
> |
if (firewallProcess.getProcess() != null) { |
677 |
> |
firewallProcess.getProcess().destroy(); |
678 |
> |
firewallProcess.setProcess(null); |
679 |
|
Conient.addMessage("WARNING{firewall}: firewall process destroyed"); |
680 |
|
} |
681 |
|
} |
758 |
|
* The process used to start the firewall pipe |
759 |
|
* for the control link. |
760 |
|
*/ |
761 |
< |
private Process _controlFirewallProcess = null; |
761 |
> |
private TunnelProcess _controlFirewallProcess = new TunnelProcess(); |
762 |
|
|
763 |
|
/** |
764 |
|
* The process used to start the firewall pipe |
765 |
|
* for the data link. |
766 |
|
*/ |
767 |
< |
private Process _dataFirewallProcess = null; |
767 |
> |
private TunnelProcess _dataFirewallProcess = new TunnelProcess(); |
768 |
|
|
769 |
|
//---STATIC ATTRIBUTES--- |
770 |
|
|