After processing the registration, the server that received the registration request sends the SC_REPLY message on the TCP connection that the client opened. The server closes the connection. The client must keep the TCP connection open until it receives the SC_REPLY message from the server.
For example, the client carries out the following actions:
Opens a TCP connection to the server
Waits for a connection to be “writable”
Sends an SC_CALLBACK_REG message (which contains an ADD_CLIENT message)
Waits for an SC_REPLY message from the server
Receives an SC_REPLY message from the server
Receives an indicator that the server has closed the connection (reads 0 bytes from the socket)
Closes the connection
At a later point in time, the client carries out the following actions:
Opens a TCP connection to the server
Waits for a connection to be “writable”
Sends an SC_CALLBACK_REG message (which contains a REMOVE_CLIENT message)
Waits for an SC_REPLY message from the server
Receives an SC_REPLY message from the server
Receives an indicator that the server has closed the connection (reads 0 bytes from the socket)
Closes the connection
Each time that the server receives an SC_CALLBACK_REG message from a client, the server sends an SC_REPLY message on the same open connection. This message specifies whether the operation succeeded or failed. SC_REPLY XML DTD contains the XML document type definition of an SC_REPLY message, and the possible error messages that this message can include.