def run_master(hang=False):
logger = asiodnp3.ConsoleLogger().Create()<EOL>manager = asiodnp3.DNP3Manager(<NUM_LIT:1>, asiodnp3.ConsoleLogger().Create())<EOL>channel = manager.AddTCPClient("<STR_LIT>",<EOL>FILTERS,<EOL>asiopal.ChannelRetry(),<EOL>HOST,<EOL>LOCAL,<EOL>PORT,<EOL>asiodnp3.PrintingChannelListener().Create())<EOL>stack_config = asiodnp3.MasterStackConfig()<EOL>stack_config.master.responseTimeout = openpal.TimeDuration().Seconds(<NUM_LIT:2>)<EOL>stack_config.link.RemoteAddr = <NUM_LIT:10><EOL>soe_handler = asiodnp3.PrintingSOEHandler().Create()<EOL>default_master_app = asiodnp3.DefaultMasterApplication().Create()<EOL>master = channel.AddMaster("<STR_LIT>",<EOL>soe_handler,<EOL>default_master_app,<EOL>stack_config)<EOL>master.Enable()<EOL>time.sleep(<NUM_LIT:2>)<EOL>if not hang:<EOL><INDENT>del channel<EOL>del master<EOL><DEDENT>print("<STR_LIT>".format(hang))<EOL>manager.Shutdown()<EOL>
Demonstrate hanging when channel and master are not deleted prior to manager.Shutdown()