Wednesday, September 12, 2007

Try...Finally Behavior

I needed to close a port after I finished to use it. The problem was if the communication fail, after the port was opened; I would like force it to close. The Try...Finally behavior is after Exception happened the immediately Finally code segment is executed and the parent Catch get the execution control.

In summary: It closes port always, but doesn't handle exceptions. It works for me.

Do have someone another alternative?

No comments:

Google