middleware, so to speak

T

Tiger Hillside

I have hit a wall. I have some server side perl scripts. One of those
scripts has to send off to another server (hence the middleware
comment) and wait for a response. Then I need to get back to the
client. I don't know how to do this. I can send off the post to the
external server. And I know how to get the response back in another of
my perl scripts. But how does that script know how to get back to the
client?

Le me diagram and name things.

This is the logic flow

Client -> Me -> XS (external sever)->Me -> Client

Program wise it would be

Client ->Me Script1 -> XS

XS -> Script2 -> Client

I can't see how to get XS to come back to the same instance of
Script1, nor can I see how Script2 would know which client to send to.
I am sure this is easy, something like having a connection handle, but
I don't know what that is called or how to get it. If I had it I can
save it with Script1 and get it back with Script2, I can identify the
transaction from my perspective, but not from the servers. (This is an
Apache server if that matters.)

(I know this is not really a language issue, but I figured this would
be a good place to ask.)

Thanks much in advance.
 
J

Joe Smith

Tiger said:
I have hit a wall. I have some server side perl scripts. One of those
scripts has to send off to another server (hence the middleware
comment) and wait for a response. Then I need to get back to the
client. I don't know how to do this. I can send off the post to the
external server. And I know how to get the response back in another of
my perl scripts. But how does that script know how to get back to the
client?

Le me diagram and name things.

This is the logic flow

Client -> Me -> XS (external sever)->Me -> Client

Thinking of the problem that way will cause problems.
Try this diagram instead.

t=0 Client Middle Backend Server
t=1 ---->
t=2 parse request
t=3 ----->
t=4 perform action
t=5 <-----
t=6 reformat results
t=7 <------
t=8 display

The connection between the client and the middle is kept open while
the middle talks to the backend. When the middle gets the results
back from the backend server, it translates them to html and
presents the results to the client, who has been waiting patiently
all this time.

In some cases, the client can be redirected to a URL that points
to a temporary file on the backend server.

t=9 redirect ------------------------>
t=10 <------------------------ temporary file

-Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,477
Members
44,898
Latest member
BlairH7607

Latest Threads

Top