Data stream messages provide a way for clients and Open Server applications to exchange information.
RPCs provide similar functionality, but in the client-to-server direction only. Messages work in both directions, making them suitable for a wide variety of communications purposes. For example, Sybase uses messages to perform security handshaking at login time.
A message consists of a message ID and zero or more parameters. The client and Open Server application must be programmed to agree on the meaning of each message ID.
User-defined message IDs must be greater than or equal to CS_USER_MSGID and less than or equal to CS_USER_MAX_MSGID. Message IDs SRV_MINRESMSG through SRV_MAXRESMSG are reserved for internal Sybase use.
A client application sends a message by calling ct_command with type set to CS_MSG_CMD. This triggers a SRV_MSG event in the Open Server application.