225 |
|
Conient.addMessage("ERROR{control link}: " + e); |
226 |
|
_controlLink = null; |
227 |
|
// and the firewall handler if there is one |
228 |
< |
if (_controlFirewallProcess != null) { |
229 |
< |
_controlFirewallProcess.destroy(); |
230 |
< |
_controlFirewallProcess = null; |
231 |
< |
} |
228 |
> |
closeFirewall(_controlFirewallProcess); |
229 |
|
_actionQueue.clearQueue(_myQueue); |
230 |
|
Conient.setControlStatus("Disconnected"); |
231 |
|
} |
297 |
|
// print the error and tidy up what's left |
298 |
|
Conient.addMessage("ERROR{data link}: " + e); |
299 |
|
_dataLink = null; |
303 |
– |
_actionQueue.clearQueue(_myQueue); |
300 |
|
// and the firewall handler if there is one |
301 |
< |
if (_dataFirewallProcess != null) { |
302 |
< |
_dataFirewallProcess.destroy(); |
307 |
< |
_dataFirewallProcess = null; |
308 |
< |
} |
301 |
> |
closeFirewall(_dataFirewallProcess); |
302 |
> |
_actionQueue.clearQueue(_myQueue); |
303 |
|
Conient.setDataStatus("Disconnected"); |
304 |
|
} |
305 |
|
} |
350 |
|
_dataLink = null; |
351 |
|
|
352 |
|
// and the firewall handler if there is one |
353 |
< |
if (_dataFirewallProcess != null) { |
360 |
< |
_dataFirewallProcess.destroy(); |
361 |
< |
_dataFirewallProcess = null; |
362 |
< |
} |
353 |
> |
closeFirewall(_dataFirewallProcess); |
354 |
|
|
355 |
|
Conient.setDataStatus("Disconnected"); |
356 |
|
} catch (IOException e) { |
361 |
|
_dataInBound.close(); |
362 |
|
_dataLink.close(); |
363 |
|
// and the firewall handler if there is one |
364 |
< |
if (_dataFirewallProcess != null) { |
374 |
< |
_dataFirewallProcess.destroy(); |
375 |
< |
_dataFirewallProcess = null; |
376 |
< |
} |
364 |
> |
closeFirewall(_dataFirewallProcess); |
365 |
|
} catch (IOException e2) { |
366 |
|
Conient.addMessage("CRITICAL{control link}: unable to close socket - " + e2); |
367 |
|
} |
403 |
|
_controlLink = null; |
404 |
|
|
405 |
|
// and the firewall handler if there is one |
406 |
< |
if (_controlFirewallProcess != null) { |
419 |
< |
_controlFirewallProcess.destroy(); |
420 |
< |
_controlFirewallProcess = null; |
421 |
< |
} |
406 |
> |
closeFirewall(_controlFirewallProcess); |
407 |
|
|
408 |
|
Conient.setControlStatus("Disconnected"); |
409 |
|
} catch (IOException e) { |
413 |
|
_outBound.close(); |
414 |
|
_controlLink.close(); |
415 |
|
// and the firewall handler if there is one |
416 |
< |
if (_controlFirewallProcess != null) { |
432 |
< |
_controlFirewallProcess.destroy(); |
433 |
< |
_controlFirewallProcess = null; |
434 |
< |
} |
416 |
> |
closeFirewall(_controlFirewallProcess); |
417 |
|
} catch (IOException e2) { |
418 |
|
Conient.addMessage("CRITICAL{control link}: unable to close socket - " + e2); |
419 |
|
} |
551 |
|
} |
552 |
|
} |
553 |
|
return server; |
554 |
+ |
} |
555 |
+ |
|
556 |
+ |
/** |
557 |
+ |
* Checks to see if the given firewall process |
558 |
+ |
* has been created. If it has it calls destroy() |
559 |
+ |
* on it. |
560 |
+ |
* |
561 |
+ |
* @param firewallProcess the process to check |
562 |
+ |
*/ |
563 |
+ |
private void closeFirewall(Process firewallProcess) { |
564 |
+ |
if (firewallProcess != null) { |
565 |
+ |
_dataFirewallProcess.destroy(); |
566 |
+ |
_dataFirewallProcess = null; |
567 |
+ |
Conient.addMessage("WARNING{firewall}: firewall process destroyed"); |
568 |
+ |
} |
569 |
|
} |
570 |
|
|
571 |
|
/** |