SMA and LLA Guide : solidDB® Server Control API (SSC API) : SSC API reference : SSCSetState
  
SSCSetState
The SSCSetState functions controls whether the server accepts subsequent connections.
The SSCSetState functions sets the state of an LLA or SMA server to open or closed. If the server is set to open, the server accepts connections. If the server is set to closed, it does not accept any further connections (local or remote). However, any connections that have already been made are allowed to continue.
SscRetT SSC_CALL SSCSetState(SscServerT h,SscStateT runflags)
Parameters
Parameter
Usage type
Description
h
in, use
Handle to the server.
runflags
in
The value for this parameter is a combination of 2 flags: the open flag and the netcopy disabling flag. The following flag symbols can be used:
SSC_STATE_OPEN – the open flag is set to 1: new connections are allowed.
SSC_STATE_CLOSED – the open flag is set to 0: all new network, LLA, and SMA connections are rejected, except for connections from solidDB® Remote Control (solcon) program.
SSC_DISABLE_NETCOPY – the netcopy disabling flag is set to 1: in HotStandby configuration, no netcopy can be received by the server for which SSC_DISABLE_NETCOPY is set.
The flag does not prevent the server to act as a source of netcopy. If only SSC_DISABLE_NETCOPY flag is set, the server is in the closed state. To enable netcopy, use the SSC API function SSCSetState() with the runflag value SSC_STATE_OPEN or SSC_STATE_CLOSED.
runflags = SSC_STATE_OPEN | SSC_STATE_CLOSED | SSC_DISABLE_NETCOPY
The flags can be used in combinations, for example:
...
rc = SSCStartServer(g_argc, g_argv, &hh, SSC_STATE_OPEN|SSC_DISABLE_NETCOPY);
...
If the server is started as closed, it can be opened with ADMIN COMMAND 'open', or with the solcon command open. The same effect can be achieved with the SSC API function SSCSetState().
Return value
SSC_SUCCESS - Operation is successful.
SSC_ERROR - Operation failed.
SSC_SERVER_INNETCOPYMODE - The server is in netcopy mode (HotStandby only).
SSC_SERVER_NOTRUNNING - The server is not running.
Comments
This function has a corresponding solidDB® SQL extension ADMIN COMMAND. The command is:
ADMIN COMMAND 'close'
See also
SSC API reference