package hprose.example.push;

import hprose.server.HproseTcpServer;
import hprose.util.concurrent.Timer;
import java.io.IOException;
import java.net.URISyntaxException;

public class TimePushServer {
    public static void main(String[] args) throws URISyntaxException, IOException {
        HproseTcpServer server = new HproseTcpServer("tcp://0.0.0.0:8080");
        server.publish("time");
        server.start();
        Timer timer = new Timer(
                () -> server.push("time", java.util.Calendar.getInstance())
        );
        timer.setInterval(1000);
        System.out.println("START");
        System.in.read();
        server.stop();
        System.out.println("STOP");
    }
}

@@ -161,16 +161,43 @@
 ception;
+%0Aimport java.util.Calendar;
 %0A%0Apublic
@@ -472,25 +472,8 @@
 mer(
-%0A                
 () -
@@ -494,26 +494,16 @@
 %22time%22, 
-java.util.
 Calendar
@@ -517,25 +517,16 @@
 tance())
-%0A        
 );%0A     

Update TimePushServer.java