Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-34139

Refactor TcpServer to avoid child classes sending data to Component directly in Phase 1

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: ts_main_telescope
    • Labels:

      Description

      This is a very low-priority ticket.

      After working on the ticket DM-34086 we noticed TcpServer can be refactored to avoid TcpServerCmd.processPacket.vi sending the "unknown" packet received to the Component directly. Instead, this packet has to be received by the TcpServer class. In TcpServerCmd.processPacket.vi the commands, events, and unknown messages are received from the TCP client, processed, and sent to the Component through the "user event" technique. To improve this we can:

      1.- Modify TcpServer.getClientStatus.vi to receive the unknown message that will be sent by TcpServerCmd.processPacket.vi. To do this, we can replace the user event with the notifier. This needs to be evaluated.

      2.- Create a new process in TcpServer.runServer.vi to receive the user event (or notifier) with commands/events received from the TCP client in the TcpServerCmd.processPacket.vi. The use of user events or notifiers needs to be evaluated.

      3.- TcpServerCmd.processPacket.vi is only one of the VIs that need to modify. There are others that handle the errors, for instance, TcpServerBase.clearErrorAndSendExplnation.vi.

      With modification #1 we will avoid the user using the areClientConnected boolean and the connStatusMsg string to get the clients' change of status.

        Attachments

          Issue Links

            Activity

            Hide
            pcortes Patricio Cortes added a comment -
            Show
            pcortes Patricio Cortes added a comment - Help to check this PR: https://github.com/lsst-ts/ts_labview_tcp_json/pull/40 Thanks.
            Hide
            ttsai Te-Wei Tsai added a comment - - edited

            This ticket was triggered by DM-34086, and the areClientsConnected boolean was replaced by an enum with elements: (1) unknown, (2) connected, and (3) unconnected. Therefore, this ticket is try to find a simple way to fix this workaround happened at DM-34086.

            We prefer to have a simple way to put areClientsConnected back to boolean if it is possible. Since the original workaround method is easy and not too bad, this ticket should not introduce too much complexity. Otherwise, it might be worthless to sacrifice the maintainability to just fix this workaround.

            Show
            ttsai Te-Wei Tsai added a comment - - edited This ticket was triggered by DM-34086 , and the areClientsConnected boolean was replaced by an enum with elements: (1) unknown, (2) connected, and (3) unconnected. Therefore, this ticket is try to find a simple way to fix this workaround happened at DM-34086 . We prefer to have a simple way to put areClientsConnected back to boolean if it is possible. Since the original workaround method is easy and not too bad, this ticket should not introduce too much complexity. Otherwise, it might be worthless to sacrifice the maintainability to just fix this workaround.
            Hide
            pcortes Patricio Cortes added a comment - - edited

            I'm going to put this ticket as Phase  1 and going to create a new Phase 2 ticket (DM-36016) to evaluate if is possible to find a simple way to fulfill this requirement. 

            Show
            pcortes Patricio Cortes added a comment - - edited I'm going to put this ticket as Phase  1 and going to create a new Phase 2 ticket ( DM-36016 ) to evaluate if is possible to find a simple way to fulfill this requirement. 
            Hide
            pcortes Patricio Cortes added a comment -

            After my discussion with Te-Wei, we decided to close this ticket and continue with ticket DM-36016.

            Show
            pcortes Patricio Cortes added a comment - After my discussion with Te-Wei, we decided to close this ticket and continue with ticket DM-36016 .

              People

              Assignee:
              pcortes Patricio Cortes
              Reporter:
              pcortes Patricio Cortes
              Reviewers:
              Te-Wei Tsai
              Watchers:
              Patricio Cortes, Te-Wei Tsai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.