We're updating the issue view to help you get more done. 

event handler of client state

Description

I want to handle state of client for onLogon, onLogout, onConnect, onDisconnect.
How can I detect 4 state of client?

  • onConnect
    FIX8::SessionInstanceBase *inst(this->create_server_instance());
    inst->start(false);
    onConnect(inst);

  • onLogon
    bool FIX8Session::authenticate(FIX8::SessionID& id, const FIX8::Message *msg) {
    parent->onLogon(this);
    }

  • onLogout, onDisconnect
    void FIX8Session::state_change(const FIX8::States::SessionStates before,
    const FIX8::States::SessionStates after) {
    if (after == FIX8::States::st_logoff_sent ||
    after == FIX8::States::st_logoff_received) {
    if (logined()) {
    parent->OnLogout(this);
    }
    }
    } else if (after == FIX8::States::st_session_terminated) {
    if (connected() || logined()) {
    parent->OnDisconnected(this);
    }
    }
    }

Is that code right?
How can i detect four state?

Environment

None

Status

Assignee

David Dight

Reporter

benzmark

Labels

None

Branch

master

Products

Open Source

Components

Fix versions

Affects versions

1.3.2

Priority

Major