mirror of
https://github.com/deavminet/skippy.git
synced 2024-12-23 06:42:07 +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)
|
||||
{
|
||||
/* Check for notifications every 2 seconds */
|
||||
NotificationReply[] notifications =manager.popNotifications();
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
/* Await a notification */
|
||||
byte[] notification = manager.awaitNotification();
|
||||
process(notification);
|
||||
|
||||
/* TODO: Below? */
|
||||
Thread.getThis().sleep(dur!("seconds")(2));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user