Node.sendMessage

Sends a message to the node.

  1. void sendMessage(ubyte[] payload)
    class Node
    void
    sendMessage
    (
    ubyte[] payload
    )
  2. void sendMessage(string message)

Examples

// if the other node uses the same JSON protocol
node.sendMessage(`{"reply_with":12}`);
server += (NodeMessageEvent event) {
   if(node == event.node) {
      assert(parseJSON(cast(string)event.payload)["reply"].integer == 12);
   }
}

Meta