In the SRV_DISCONNECT event handler, your application must check SRV_T_MIGRATE_STATE to determine the client’s migration state:
A migration state of SRV_MIG_REQUESTED indicates that the SRV_DISCONNECT event has been triggered because the Open Server application terminated the connection before the client could respond to the migration request.
A migration state of SRV_MIG_MIGRATING indicates that the SRV_DISCONNECT event has been triggered because the client application, after a successful migrating to the new server, closed the connection.
For all other migration states, the client must make sure that connection-specific context is cleaned up because no other server will pick up this context.