1 | #include <stdio.h>
|
---|
2 |
|
---|
3 | #include <Messenger.h>
|
---|
4 | #include <OS.h>
|
---|
5 |
|
---|
6 |
|
---|
7 | struct MessengerPrivate {
|
---|
8 | port_id port;
|
---|
9 | int32 handlerToken;
|
---|
10 | team_id team;
|
---|
11 |
|
---|
12 | int32 reserved[3];
|
---|
13 | };
|
---|
14 |
|
---|
15 | int main()
|
---|
16 | {
|
---|
17 | BMessenger server("application/x-vnd.Haiku-app_server");
|
---|
18 | if (!server.IsValid())
|
---|
19 | return 1;
|
---|
20 |
|
---|
21 | auto priv = reinterpret_cast<MessengerPrivate*>(&server);
|
---|
22 | printf("port: %" B_PRId32 "\n", priv->port);
|
---|
23 |
|
---|
24 | int32 msg;
|
---|
25 | while (read_port(priv->port, &msg, NULL, 0) >= B_OK) {}
|
---|
26 |
|
---|
27 | return 0;
|
---|
28 | }
|
---|