@Test public void shouldAttemptLogonOnlyOnce() { session.id(SESSION_ID); session.poll(0); session.poll(10); session.poll(20); verifyLogon(); }
public int poll(final long time) { int actions = 0; if (state() == SessionState.CONNECTED && id() != UNKNOWN) { state(SessionState.SENT_LOGON); final int heartbeatIntervalInS = (int)(heartbeatIntervalInMs() / 1000); final int sentSeqNum = resetSeqNum ? 1 : newSentSeqNum(); final long position = proxy.sendLogon(sentSeqNum, heartbeatIntervalInS, username(), password(), resetSeqNum, sequenceIndex(), lastMsgSeqNumProcessed()); if (position >= 0) { lastSentMsgSeqNum(sentSeqNum); } actions++; } return actions + super.poll(time); }
InitiatorSession extends InternalSession { public int poll(final long time) { int actions = 0; if (state() == SessionState.CONNECTED && id() != UNKNOWN) { state(SessionState.SENT_LOGON); final int heartbeatIntervalInS = (int)(heartbeatIntervalInMs() / 1000); final int sentSeqNum = resetSeqNum ? 1 : newSentSeqNum(); final long position = proxy.sendLogon(sentSeqNum, heartbeatIntervalInS, username(), password(), resetSeqNum, sequenceIndex(), lastMsgSeqNumProcessed()); if (position >= 0) { lastSentMsgSeqNum(sentSeqNum); } actions++; } return actions + super.poll(time); } }
InitiatorSession extends InternalSession { public int poll(final long time) { int actions = 0; if (state() == SessionState.CONNECTED && id() != UNKNOWN) { state(SessionState.SENT_LOGON); final int heartbeatIntervalInS = (int)(heartbeatIntervalInMs() / 1000); final int sentSeqNum = resetSeqNum ? 1 : newSentSeqNum(); final long position = proxy.sendLogon(sentSeqNum, heartbeatIntervalInS, username(), password(), resetSeqNum, sequenceIndex(), lastMsgSeqNumProcessed()); if (position >= 0) { lastSentMsgSeqNum(sentSeqNum); } actions++; } return actions + super.poll(time); } InitiatorSession(
        final int heartbeatInterval,
        final long connectionId,
        final EpochClock epochClock,
        final Clock clock,
        final SessionProxy proxy,
        final GatewayPublication inboundPublication,
        final GatewayPublication outboundPublication,
        final SessionIdStrategy sessionIdStrategy,
        final long sendingTimeWindow,
        final AtomicCounter receivedMsgSeqNo,
        final AtomicCounter sentMsgSeqNo,
        final int libraryId,
        final int initialSentSequenceNumber,
        final int sequenceIndex,
        final SessionState state,
        final boolean resetSeqNum,
        final long reasonableTransmissionTimeInMs,
        final MutableAsciiBuffer asciiBuffer,
        final boolean enableLastMsgSeqNumProcessed,
        final SessionCustomisationStrategy customisationStrategy,
        final OnMessageInfo messageInfo,
        final EpochFractionClock epochFractionClock); }
InitiatorSession extends InternalSession { public int poll(final long time) { int actions = 0; if (state() == SessionState.CONNECTED && id() != UNKNOWN) { state(SessionState.SENT_LOGON); final int heartbeatIntervalInS = (int)(heartbeatIntervalInMs() / 1000); final int sentSeqNum = resetSeqNum ? 1 : newSentSeqNum(); final long position = proxy.sendLogon(sentSeqNum, heartbeatIntervalInS, username(), password(), resetSeqNum, sequenceIndex(), lastMsgSeqNumProcessed()); if (position >= 0) { lastSentMsgSeqNum(sentSeqNum); } actions++; } return actions + super.poll(time); } InitiatorSession(
        final int heartbeatInterval,
        final long connectionId,
        final EpochClock epochClock,
        final Clock clock,
        final SessionProxy proxy,
        final GatewayPublication inboundPublication,
        final GatewayPublication outboundPublication,
        final SessionIdStrategy sessionIdStrategy,
        final long sendingTimeWindow,
        final AtomicCounter receivedMsgSeqNo,
        final AtomicCounter sentMsgSeqNo,
        final int libraryId,
        final int initialSentSequenceNumber,
        final int sequenceIndex,
        final SessionState state,
        final boolean resetSeqNum,
        final long reasonableTransmissionTimeInMs,
        final MutableAsciiBuffer asciiBuffer,
        final boolean enableLastMsgSeqNumProcessed,
        final SessionCustomisationStrategy customisationStrategy,
        final OnMessageInfo messageInfo,
        final EpochFractionClock epochFractionClock); int poll(final long time); }
InitiatorSession extends InternalSession { public int poll(final long time) { int actions = 0; if (state() == SessionState.CONNECTED && id() != UNKNOWN) { state(SessionState.SENT_LOGON); final int heartbeatIntervalInS = (int)(heartbeatIntervalInMs() / 1000); final int sentSeqNum = resetSeqNum ? 1 : newSentSeqNum(); final long position = proxy.sendLogon(sentSeqNum, heartbeatIntervalInS, username(), password(), resetSeqNum, sequenceIndex(), lastMsgSeqNumProcessed()); if (position >= 0) { lastSentMsgSeqNum(sentSeqNum); } actions++; } return actions + super.poll(time); } InitiatorSession(
        final int heartbeatInterval,
        final long connectionId,
        final EpochClock epochClock,
        final Clock clock,
        final SessionProxy proxy,
        final GatewayPublication inboundPublication,
        final GatewayPublication outboundPublication,
        final SessionIdStrategy sessionIdStrategy,
        final long sendingTimeWindow,
        final AtomicCounter receivedMsgSeqNo,
        final AtomicCounter sentMsgSeqNo,
        final int libraryId,
        final int initialSentSequenceNumber,
        final int sequenceIndex,
        final SessionState state,
        final boolean resetSeqNum,
        final long reasonableTransmissionTimeInMs,
        final MutableAsciiBuffer asciiBuffer,
        final boolean enableLastMsgSeqNumProcessed,
        final SessionCustomisationStrategy customisationStrategy,
        final OnMessageInfo messageInfo,
        final EpochFractionClock epochFractionClock); int poll(final long time);  }