4 Xbox stands for "cross-box" communication, and it's a very simple messaging
5 system. There are only 2 functions to learn,
8 $code = xbox_send_message($msg, $ret, $timeout_ms, $host);
9 $code = xbox_post_message($msg, $host);
11 1. xbox_send_message()
13 xbox_send_message() is a blocking call. It will send the message, which is just
14 a string, to specified host. It waits for $timeout_ms long and returns 0 if
15 times out. On the specified host's side, there has to be an xbox server that's
16 set up through compiled program's options, and one also has to implement a PHP
19 function xbox_process_message($msg) {
24 The final result gets returned to the caller if timeout hasn't been reached and
25 the $code would be 200. The function name is configurable, but it is by design
26 to have just one function to serve as main entry point of all messages. A
27 message string can encode message types by itself.
29 2. xbox_post_message()
31 xbox_post_message() is a non-blocking call. It will not wait for server to
32 process the message and it will return 200 immediately, unless server cannot
37 When $host is local, xbox task functions give more control over task statuses.
38 In that case, xbox processing becomes a multi-threading facility that's better
39 described in "threading" documentation.