I know you were told that it should close the port, but I am not sure
about it. It should close the port it opened, but should it also the
one it got? This will prevent the same port being processed multiple
times, which could be annoying.
I'm sorry folks, I regretted to give this suggestion, it's not a good idea after my carefully thought. It's better to let caller decide.