Create example directory and separate client/server.
This commit is contained in:
parent
ce7716463d
commit
9007eacdf3
8 changed files with 46 additions and 13 deletions
21
examples/client/source/client.d
Normal file
21
examples/client/source/client.d
Normal file
|
@ -0,0 +1,21 @@
|
|||
import std.stdio;
|
||||
import ddbus;
|
||||
|
||||
void testCall(Connection conn) {
|
||||
for(int i = 0; i < 50; i++) {
|
||||
Message msg = Message("ca.thume.transience","/ca/thume/transience/screensurface",
|
||||
"ca.thume.transience.screensurface","testDot");
|
||||
conn.sendBlocking(msg);
|
||||
}
|
||||
Message msg2 = Message("ca.thume.transience","/ca/thume/transience/screensurface",
|
||||
"ca.thume.transience.screensurface","testPing");
|
||||
Message res = conn.sendWithReplyBlocking(msg2,3000);
|
||||
int result = res.read!int();
|
||||
writeln(result);
|
||||
}
|
||||
|
||||
void main() {
|
||||
Connection conn = connectToBus();
|
||||
testCall(conn);
|
||||
writeln("It worked!");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue