PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Session Check  (Read 1401 times)

edjack

  • Silver Member
  • ***
  • Posts: 45
  • Computerease
    • View Profile
Session Check
« on: August 08, 2019, 01:47:42 PM »
I there a way to check that a pvxplus session is active and if not launch it.
Maybe a background pvx program running continuously or a 3rd party app??
Ed Jack
Computerease

Ben Alexander

  • Member
  • **
  • Posts: 5
    • View Profile
Re: Session Check
« Reply #1 on: August 08, 2019, 03:34:16 PM »
I was about to ask the same question.  My old methods are not working now.

Mike King

  • Diamond Member
  • *****
  • Posts: 3817
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Session Check
« Reply #2 on: August 08, 2019, 03:44:50 PM »
There isn't really a direct way to to this.

On Windows you could set your Caption to some specific value and then in the other programs use FindWindowA to search for that caption, but that's a Windows only solution.

What I would suggest is to simply create a generic control file and have the processes that you want to check on simply lock/extract specific records.  If you want to see if the process is running just try to access the associated record and if that request fails then the process is running.  Also, should a process die (gracefully or not) the lock will be cleared.

This approach also has the advantage that the control file could in fact be accessed remotely using mapped/mounted drives.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Ben Alexander

  • Member
  • **
  • Posts: 5
    • View Profile
Re: Session Check
« Reply #3 on: August 08, 2019, 03:54:13 PM »
I am trying to get an rpc server session running in the background but when I disconnect from the system it dies. Using a crontab entry comes to mind but I do not know what to look for in the ps -ale.