About the Event
-
hi,victor
When the Event generate in the Server. We can see the Event in the Console. Does the console active "ask" the Server whether an Event generate circularly? Or the Server active "tell" the Console in time when an Event is generate ?
I saw the code,it may be the second situation. But I am writing my own client with java api. I don't know how I can get it in java api when the Server "tell" the client a Event is generations.?
Thanks! -
Hi!
Server sends notification to client when new event created. Client must be subscribed to event notifications. Simple code for receive event notifications can looks like this:
// subscribe session.subscribe(CHANNEL_EVENTS); // add notification handler session.addListener(new SessionListener() { @Override public void notificationHandler(final SessionNotification n) { if (n.getCode() == NXCNotification.NEW_EVENTLOG_RECORD) { Event e = (Event)n.getObject(); // do what you need with event object } } });Remember that notification handler called in background communication thread and should not perform any long-running tasks.
Best regards,
Victor -
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login