Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: SSREQUEST Question Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: December 17 2011 at 13:09 | IP Logged Quote BeachBum

I’m lost as to the way an SSREQUEST executes. It appears if I send a request to one system and want to respond the response is held up until the original request times out. Is there a way to satisfy the ssrequest and not have to wait for it to go away? I can clear the execution queue and problem resolved BUT I’m sure that will create another problem down the line. In simple terms I’m trying to run conversational.

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: January 15 2012 at 11:07 | IP Logged Quote BeachBum

Interesting tidbit.. If I throw a .5 Wait the other executes immediately. Still don’t understand the workings.

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: January 16 2012 at 16:54 | IP Logged Quote dhoward

Pete,

I would probably need to see the actual details of how you're trying to setup the conversation. I can foresee a problem where if you make a FORMULA request from PH1 to PH2 and the actual formula contains a ph_ssrequest back to PH1, this probably wouldnt work so well. If this is what you're doing, you would want to POST the ph_ssrequest function back to PH1.

The socket server works very similar to a standard HTTP or web server. The server is listening for connections and when one is initiated, a new socket is spawned. The request is processed and if the request is a FORMULA, the formula is executed (depending upon the formula, this could take awhile). Once the formula is complete, the result is passed back on the open socket and the socket is closed. This is what triggers the end of the ph_ssrequest. Any formula passed in goes to the execution queue so it can be processed.

What I envision is happening, is that on PH1, you're making a ph_ssrequest to PH2 of type FORMULA. PH2 receives the request and places the formula in its execution queue. It probably processes fairly quickly and the formula probably contains a reciprocal ph_ssrequest back to PH1. This call is made and the PH1 SS receives the callback FORMULA. This will go to the end of PH1's execution queue and wont be executed because the PH1 execution queue is still waiting for the original ph_ssrequest to return (which it won't because its waiting for the reciprocal ph_ssrequest to return). By "posting" this ph_ssrequest, the formula is able to be processed without having to wait.

From reading your email, it sounds as if the FORMULA is probably a macro. By placing a "Wait" command in the macro, the macro terminates as soon as the "Wait" is encountered. The formula returns and the PH1 execution queue can continue. After the Wait period expires, the macro is again thrown into the execution queue (on PH2) to continue on with its processing. You've essentially "posted" the remaining macro lines and solved the problem that way. You could essentially place a .01 wait as the first line of the macro and you'll get an immediate return. If the formula return (or at least part of it) is necessary to PH1, you could place those statements at the top of the macro and then the Wait before anything that would cause a hang or is unnecessary to the PH1 return.

Hope this helps,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: January 16 2012 at 23:57 | IP Logged Quote BeachBum

Dave, you hit the nail on the head. Suspected it was caught up in the queue and the wait broke it up. I use 2 ways of sending the formula across. One is imbedded in a global that is remotely executed and the other uses a ph_postformula. The sending of data imbedded in setGlobals goes seamlessly while execution of formulas go into an 8 second wait. BTW I’m trying to make my remote CC screens interactive without having to do a refresh.

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum