Warning: This feature is experimental and subject to change.
Summary:
See also: Classes and Objects, Form Specification File
The MessageServer class allows a program to send a key action over the network to other programs using this service. The action transmission is not guaranteed.
base.MessageServer
Class Methods | |
Name | Description |
connect() |
Connects to the group of programs to be notified by a message. |
send( keyname STRING ) |
Sends a key event to the group of programs connected together. |
The MessageServer class can be used to join a group of programs to be notified by simple messages (i.e. key events). The programs can run on different machines connected together in a network.
Note that the MessageServer uses network API capabilities with Sockets and the UDP protocol. While this is obvious, make sure the computers are configured with a network. Note that the UDP protocol does not guarantee the transmission of datagrams. Therefore, messages sent with the MessageServer can arrive out of order, duplicated, or go missing without notice.
The UDP port used is 6600, the IP address group is 224.0.1.1, and this cannot be changed.
First the program must call the base.MessageServer.connect()
class method to
join the group of programs that can be notified by a message.
Once connected to the message server group, a program can call the base.MessageServer.send()
class method
to notify other programs registered to the group.
01
CALL base.MesageServer.connect()02
CALL base.MessageServer.send("f1")
All programs registered to the message server group (including the program which has sent the message) will be notified. The messages can be treated by the current dialog with a simple ON KEY() interaction block.
01
MAIN02
CALL base.MessageServer.connect()03
MENU "test"04
COMMAND "send F1" CALL base.MessageServer.send("f1")05
ON KEY (F1) DISPLAY "Key F1 received..."06
COMMAND "quit" EXIT MENU07
END MENU08
END MAIN