我试图了解以下子项目的工作方式,
Private Shared Sub checkManagerAPI()
manager = New ManagerConnection(ASTERISK_HOST, ASTERISK_PORT, ASTERISK_LOGINNAME, ASTERISK_LOGINPWD)
manager.RegisterUserEventClass(GetType(UserAgentLoginEvent))
AddHandler manager.UserEvents, New EventHandler(Of UserEvent)(AddressOf dam_UserEvents)
AddHandler manager.NewExten, New EventHandler(Of NewExtenEvent)(AddressOf manager_IgnoreEvent)
AddHandler manager.UnhandledEvent, New EventHandler(Of ManagerEvent)(AddressOf dam_Events)
manager.FireAllEvents = True
manager.PingInterval = 0
Try
manager.Login()
Console.WriteLine("Asterisk version : " & manager.Version)
Catch ex As Exception
Console.WriteLine(ex)
Console.ReadLine()
manager.Logoff()
Return
End Try
我一直在函数中使用Return,有人可以在这里解释它的作用(倒数第二行),如果发生错误,是否可以重新启动子程序? 谢谢