Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-370

Sending two logon messages when I only mean to send one?

    Details

    • Type: Other
    • Status: Closed
    • Priority: Default
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Hi,

      I have a FIX initiator that implements the Application interface, and uses the code below to log on to sessions. I connect just fine...however, I've noticed that I keep sending two logon messages instead of just one. Is there something that I am doing incorrectly?

      [code]
      // Method to determine messages that we send to the FIX Exchange (Administrator class messages)
      public void toAdmin(Message message, SessionID sessionId)
      {
      if(isMessageOfType(message, MsgType.LOGON) && (loginsent == false))
      {
      loginsent = true;

      // Get information from properties
      String user = "user";
      String password = "password";
      UserNameField usefield = new UserNameField(user);
      PasswordField passfield = new PasswordField(password);

      // Set Message References
      Message msgToMod = message;
      msgToMod.setField(usefield);
      msgToMod.setField(passfield);

      // Send Message
      try

      { Session.sendToTarget(msgToMod,sessionId); }

      catch(Exception ex)

      { System.out.println("SESSION NOT FOUND!"); ex.printStackTrace(); }

      }
      }
      [/code]

      Thanks and regards,
      hhung

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hhung Herman Hung
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: