This category includes the following APIs:
Message - NetMessageBufferSend
Message - NetMessageFileSend
Message - NetMessageLogFileGet
Message - NetMessageLogFileSet
Message - NetMessageNameAdd
Message - NetMessageNameDel
Message - NetMessageNameEnum
Message - NetMessageNameFwd
Message -NetMessageNameGetInfo
Message - NetMessageNameUnFwd
Message APIs are used to send, log, and forward messages. The administrator can run these APIs remotely. They are used with the MESSAGE.H and NETCONS.H header files.
A message is any file or buffer of data sent to a messaging name (a user or an application) on the network. To receive a message, the user or application must register its messaging name (using the NetMessageNameAdd API) in the message name table of a computer. A message name table contains a list of registered messaging names permitted to receive messages and a list of users and applications to which a message can be forwarded. Messaging names are case-sensitive and must be unique on the physical network, not just on the domain.
To delete messaging names from the message name table, use the NetMessageNameDel API.
To list all the names stored in the table, an application can call the NetMessageNameEnum API. For information about a particular user in the table, an application can call the NetMessageNameGetInfo API.
All of the message functions except NetMessageBufferSend and NetMessageFileSend require that the local computer be running the Messenger service. The NetMessageBufferSend and the NetMessageFileSend APIs only require that the remote computer receiving a message be running the Messenger service.
To send a message, an application can call either the NetMessageFileSend API (to send a file) or the NetMessageBufferSend API (to send a buffer of any data).
Any messages sent to a particular name also can be forwarded to another name at a different workstation through the NetMessageNameFwd API. The NetMessageNameUnFwd API ends message forwarding.
An application also can broadcast messages to all registered names on the network by specifying the name parameter as an asterisk (*) wildcard character for either the NetMessageFileSend API or NetMessageBufferSend API. To broadcast a message to all requesters on the LAN, have name point to an asterisk (*). To broadcast a message to a domain, have name point to a domain name followed by an asterisk (*).
Users can receive messages in one of two ways (or both at the same time):
If an application turns logging on (using NetMessageLogFileSet), all messages received for a particular user are stored in a message log file. The NetMessageLogFileGet API returns the name of a message log file of a requester or server and indicates whether message logging is enabled. The default message log file is \IBMLAN\LOGS\MESSAGES.LOG.
Each message in the log file is formatted as follows:
For example, here are two logged messages:
Message from KRISCA to AJSCHEL on Aug 04, 1990,14:05:20 Hello, this is a BUFFER message. **** Message from KRISCA to AJSCHEL on Aug 04, 1990, 14:11:48 Hello, this is a FILE message. ****
Note: Any process opening the message log file must open it in read-only, deny-none mode; otherwise, the Messenger service fails when trying to log incoming messages.