middleware, so to speak

Discussion in 'Perl' started by Tiger Hillside, Jan 23, 2004.

  1. 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.
    Tiger Hillside, Jan 23, 2004
    #1
    1. Advertising

  2. Tiger Hillside

    Joe Smith Guest

    Tiger Hillside wrote:

    > 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
    Joe Smith, Jan 24, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QnVnZ3ltYW4=?=

    I am now tearing my hair out as we speak...

    =?Utf-8?B?QnVnZ3ltYW4=?=, Jun 29, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    521
    clintonG
    Jun 30, 2005
  2. Replies:
    3
    Views:
    468
  3. skyhigh
    Replies:
    0
    Views:
    383
    skyhigh
    Apr 13, 2004
  4. Guest
    Replies:
    3
    Views:
    298
    Nick Craig-Wood
    Apr 19, 2005
  5. zdennis
    Replies:
    1
    Views:
    147
    Justin Collins
    Aug 11, 2006
Loading...

Share This Page