Changes

Jump to: navigation, search

IPDL/Five minute example

1,267 bytes added, 17:02, 13 July 2009
Created page with 'This page walks you through the steps of creating an IPDL protocol and writing the C++ code that implements the required interfaces. This guide walks you through the steps taken...'
This page walks you through the steps of creating an IPDL protocol and writing the C++ code that implements the required interfaces. This guide walks you through the steps taken to implement the testing code in <code>ipc/ipdl/test-harness</code>. You are encouraged to follow this guide step-by-step and change the code in <code>ipc/ipdl/test-harness</code> as you follow along.

== Write the IPDL specification ==

Put this in the file <code>ipc/ipdl/test-harness/Test.ipdl</code>.

sync protocol Test
{
both:
sync Ping() returns (int status);

parent:
GetValue(String key);
GetValues(StringArray keys);
sync SetValue(String key, String val) returns (bool ok);

child:
TellValue(String key, String val);
TellValues(StringArray keys, StringArray vals);

state START
recv Ping goto START;
send Ping goto START;

recv SetValue goto HAVE_VALUES;

state HAVE_VALUES
recv Ping goto HAVE_VALUES;
send Ping goto HAVE_VALUES;

recv SetValue goto HAVE_VALUES;

recv GetValue goto TELLING_VALUE;
recv GetValues goto TELLING_VALUES;

state TELLING_VALUE
send TellValue goto HAVE_VALUES;
state TELLING_VALUES
send TellValues goto HAVE_VALUES;
};
Confirm
699
edits

Navigation menu