Disconnect in a PDL?

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Disconnect in a PDL?

  • Creator
    Topic
  • #51813
    Jerry Hayes
    Participant

      [ver 5.7]

      I need to force the incoming client connection to drop in a tcp/ip PDL.

      I’ve created a line-oriented HTTP server PDL (to accept an inbound POST from a client). Everything works, reading header, verifying Content-Length, write the 200 or 404 result codes, etc, I just need to force the client connection to drop after my callback lets me know the result code has been written.

      Any thoughts?

      Thanks all,

      Jerry Hayes

    Viewing 4 reply threads
    • Author
      Replies
      • #71828
        Jerry Hayes
        Participant

          Well, no luck in trying anything at the PDL level, so I ended up moving the HTTP response generation to a TPS proc, and wrote that out similar to an HL7 ACK/NAK, (but with a HTTP 200/404 instead).

          I had to push things here so that I could use the “disconnect after write” option on the TCP/IP PDL dialog.

        • #71829
          Rob Whall
          Participant

            Jerry,

            I know this is an old post, but I’m looking to do something similar. Could you post more details about how you set this up?

            Thanks,

            Rob

          • #71830
            Rob Abbott
            Keymaster

              You can force PDL (and the native tcp/ip driver) to disconnect by sending it a message with the following keys in DRIVERCTL:

              {CLOSE 1} {TCP/IP {{CLOSE 1}}}

              Code:

              keylset kl CLOSE 1
              keylset kl TCP/IP.CLOSE 1
              msgmetaset $mh DRIVERCTL $kl

              If the message content is empty, the connection will be closed.  If the message contains data, the data will be written, then the connection will be closed.  

              Hope this helps!

              Rob Abbott
              Cloverleaf Emeritus

            • #71831
              David Barr
              Participant

                Does anyone have an example of how to do this in a reply timeout proc?

              • #71832
                Charlie Bursell
                Participant

                  PROTO the above in a zero-length message

                  I forget but you may have to enable 0-length messages

              Viewing 4 reply threads
              • The forum ‘Cloverleaf’ is closed to new topics and replies.