![]() Calling Sequences |
![]() DEVELOPER |
![]() |
The usual calling sequence for P4API is:
p4SystemLogin()
p4SetCodeSet() (optional)
p4OpenPro4()
p4ExecuteTask()
p4ClosePro4()
p4CloseSystem()
Once you have successfully completed a p4SystemLogin() and p4OpenPro4() on a particular machine using a particular PROIV environment, you can execute multiple p4ExecuteTask() calls for those settings. You can also run with more than one environment by using multiple p4OpenPro4() (and p4SystemLogin()) calls as necessary.
There is a trade-off between quick response and consuming kernel manager resources by having multiple p4SystemLogin() and p4OpenPro4() calls without corresponding ClosePro4() and p4CloseSystem() calls. If there is a gap in time between consecutive p4ExecTask() calls for a certain environment, it is recommended that you execute a p4ClosePro4() (and p4CloseSystem()), and re-execute a p4OpenPro4() (and p4SystemLogin()) for those environments.
![]() |
Remember — P4API calls are synchronous. Control is not passed back to your program until the call has finished executing. |
Topic ID: 540011