SRV_T_MIGRATE_STATE indicates the migration state of the client. It is a read-only property that any thread can access. The possible migration states are:
State |
Value |
Description |
---|---|---|
SRV_MIG_NONE |
0 |
There is no migration in progress. |
SRV_MIG_REQUESTED |
1 |
A migration has been requested by the server. |
SRV_MIG_READY |
2 |
The client has received the request and is ready to migrate. |
SRV_MIG_MIGRATING |
3 |
The client is now migrating to the specified server. |
SRV_MIG_CANCELLED |
4 |
The migration request has been cancelled. |
SRV_MIG_FAILED |
5 |
The client failed to migrate. |
SRV_MIG_STATE is an enumerated datatype that models the SRV_T_MIGRATE_STATE property. SRV_MIG_STATE is declared as:
typedef enum { SRV_MIG_NONE, SRV_MIG_REQUESTED, SRV_MIG_READY, SRV_MIG_MIGRATING, SRV_MIG_CANCELLED, SRV_MIG_FAILED } SRV_MIG_STATE;
This sample code shows how you can retrieve SRV_T_MIGRATE_STATE values; in case of a successful migration, the client exits and the SRV_DISCONNECT event handler is called with a SRV_MIG_MIGRATING status:
CS_RETCODE ret; SRV_MIG_STATE migration_state; ret = srv_thread_props(sp, CS_GET, SRV_T_MIGRATE_STATE, &migration_state, sizeof (migration_state), NULL); if (ret != CS_SUCCEED) { ... }
See “Connection migration” for more details.