Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] use of Leshan API for notifications

Hi,
   What are you trying to do ? I not sure to understand ...  Why did you use LeshanServerDemo instead of just using "leshan-server-cf" java project ?
Simon


Le 10/01/2017 à 06:13, Ramakrishnan a écrit :
Hi All,

I have created a sample listener on Java client side which talks to server side servlets to get the client details and the objects associated with it.

In my setup Eclipse LehanServerDemo is running @10.37.14.XX
My web application(talking to rest server) is running on 10.37.15.XX

In my rest server, I get the clients connected by running the below  code. Now how can my rest server notified when there is any new client connects to the server? or when the client updates the IPSO objects.
I dont want do any polling from the REST server or the application side to get the updates.

How can lesh server notify ?

Code:
           URLConnection conn = url.openConnection();
           conn.setDoOutput(true);
           System.out.println("Connected");
           
                     BufferedReader in = 
               new BufferedReader( new InputStreamReader( conn.getInputStream() ) );
           
           String response;
           while ( (response = in.readLine()) != null ) {
               System.out.println( response );
           }
           in.close();


_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev


Back to the top