简体   繁体   中英

Close port on killing python the process with children

When my python program is killed with -9 normally it also closes the port it's listening.

BUT when it has some child processes running created with Popen (which I don't really need to kill on killing parent), while killing -9 the parent it seems to leave the port in use.

How can I force to close the port even if there are children?

好的,我在执行Popen时似乎可以解决close_fds = True的问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM