Perform a stop and restart of thread after each message

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Perform a stop and restart of thread after each message

  • Creator
    Topic
  • #51060
    Matt Estrella
    Participant

      Hi to all,

      Does anyone have a solution that will allow the stopping and restarting of a thread after each message sent?

      The receiving vendor is requesting that the socket be shutdown and restarted after each message.

      As an example, if I have 3 pending messages, I will need to send the first, stop the thread, start the thread, send the second, stop/restart, send the third, then stop/restart.

      Thanks!!

    Viewing 12 reply threads
    • Author
      Replies
      • #68630
        David Barr
        Participant

          Which operating system is your Cloverleaf system running on?

        • #68631
          Matt Estrella
          Participant

            I apologized – I am using version 5.3 running on Windows 2003.

          • #68632
            David Barr
            Participant

              I can think of a few ways to do this.

            • #68633
              Matt Estrella
              Participant

                Would it be possible to use a tcl proc that will stop/start the thread after each message is sent or after each ACK is received?

              • #68634
                David Barr
                Participant

                  Matt Estrella wrote:

                  Would it be possible to use a tcl proc that will stop/start the thread after each message is sent or after each ACK is received?

                  I don’t think so.  The problem is that you’d have to do something to block the next transaction from being sent immediately, and I can’t think of a way of doing that which doesn’t also make the thread unresponsive to pstop/pstart commands.

                • #68635
                  James Cobane
                  Participant

                    Do you really need to stop/start the interface, or can you just use the configuration option to ‘close after write’ along with the ‘Delay connection until needed’ in NetConfig?

                  • #68636
                    Sam Craig
                    Participant

                      Tell the vendor they are CRAZY!!!  ðŸ˜€

                      Did they tell you why they want to cycle the thread after each message?

                    • #68637
                      Matt Estrella
                      Participant

                        They want the socket stopped then started between result messages.

                      • #68638
                        Jim Kosloskey
                        Participant

                          Yeah – but why???

                          This does not make sense to me – sounds like someone with 30 year old experience.

                          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

                        • #68639
                          Matt Estrella
                          Participant

                            The receiving vendor wants this for flow control on their end. It does not make any sense. At this time, the issue is in their court as to a resolution.

                            In the meantime, I will continue to resend every 2 minutes when an ACK is not received.

                          • #68640
                            Anonymous
                            Participant

                              Not understanding all of the issue.

                              I wonder if simple closing the port after the message was written.

                              This could be an easy test and there is a flag to do this within the configuration tool.   Just a  thought.

                            • #68641
                              Robert Milfajt
                              Participant

                                Wow!  I agree with Sam, the vendor is bonkers!

                                However, you could pull it off within the confines of current Cloverleaf.  In an sms_ob_data proc, you could add the following:

                                First line of the proc

                                Code:

                                global stopping

                                In the start section initialize stopping to 0

                                Code:

                                set stopping 0

                                In the first line of the run section

                                Code:

                                if {$stopping} return “”

                                Last line of the run section, before the return, exececute whatever system command you need to stop the thread.  In UNIX it is:

                                Code:

                                exec $env(HCIROOT)/bin/hcicmd -p -c ‘ pstop’ &

                                Then create an alert for the thread that when it stops, it runs a script to start it back up.  Of course this means anytime you stop the thread it’s going to start up again, so you probably want to set some flag (file) you can check to prevent it from starting.

                                The craziness continues,

                                Robert Milfajt
                                Northwestern Medicine
                                Chicago, IL

                              • #68642
                                David Barr
                                Participant

                                  If you really want to get this working, I still think you’re better off writing a little proxy application that sits between your Cloverleaf thread and their application.  It can’t be more than 15 lines of code.

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