mirror of
https://github.com/deavminet/skippy.git
synced 2024-12-23 14:52:04 +00:00
Moved to using new libdnet awaitNotification
This commit is contained in:
parent
0d86d22cc7
commit
4cfff3ad4f
@ -22,24 +22,11 @@ public class NotificationWatcher : Thread
|
|||||||
{
|
{
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
/* Check for notifications every 2 seconds */
|
/* Await a notification */
|
||||||
NotificationReply[] notifications =manager.popNotifications();
|
byte[] notification = manager.awaitNotification();
|
||||||
|
process(notification);
|
||||||
if(notifications.length)
|
|
||||||
{
|
|
||||||
//writeln(notifications);
|
|
||||||
foreach(NotificationReply notificationReply; notifications)
|
|
||||||
{
|
|
||||||
//writeln(notificationReply.getData());
|
|
||||||
|
|
||||||
/* Await a notification */
|
|
||||||
manager.awaitNotification();
|
|
||||||
string msg = cast(string)notificationReply.getData();
|
|
||||||
writeln("!> "~msg);
|
|
||||||
process(notificationReply.getData());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* TODO: Below? */
|
||||||
Thread.getThis().sleep(dur!("seconds")(2));
|
Thread.getThis().sleep(dur!("seconds")(2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user