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

Initiator can't reconnect if there was no network during startup.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Default
    • Resolution: Fixed
    • Affects Version/s: 1.2.1, 1.3.0
    • Fix Version/s: 1.3.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP

      Description

      IoSessionInitiator.connect() method throws UnresolvedAddressException if there is no network connection. After connection is reestablished it is not able to recover and still throws UnresolvedAddressException.

      This is because InetSocketAddress is created only ones during startup. If it was not resolved then it will never be resolved.

      Workaround is to create new InetSocketAddress each time the Initiator tries to reconnect and the address is unresolved. Modification of IoSessionInitiator.getNextSocketAddress() that fixed the problem for me:

      private SocketAddress getNextSocketAddress() {
      SocketAddress socketAddress = socketAddresses[nextSocketAddressIndex];

      if (socketAddress instanceof InetSocketAddress) {
      InetSocketAddress inetAddr = (InetSocketAddress) socketAddress;
      if (inetAddr.isUnresolved())

      { socketAddress = new InetSocketAddress(inetAddr.getHostName(), inetAddr.getPort()); socketAddresses[nextSocketAddressIndex] = socketAddress; }

      }

      nextSocketAddressIndex = (nextSocketAddressIndex + 1) % socketAddresses.length;
      return socketAddress;
      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              barlaw Bartosz Lawniczek
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: