Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hprose-java推送服务功能出现堵塞,直至服务端超时 #65

Open
byxkp opened this issue Apr 17, 2022 · 2 comments
Open

Hprose-java推送服务功能出现堵塞,直至服务端超时 #65

byxkp opened this issue Apr 17, 2022 · 2 comments

Comments

@byxkp
Copy link

byxkp commented Apr 17, 2022

场景复现:
1、服务端,每秒钟推送一次
public static void main(String[] args)throws Exception{
HproseTcpServer server=new HproseTcpServer("tcp://127.0.0.1:4321");
server.publish("time",12000,3000);
server.start();
Timer timer=new Timer();
timer.schedule(new TimerTask() {
@OverRide
public void run() {
System.out.println(LocalDateTime.now()+" "+ JSON.toJSONString(server.idlist("time") )+" "+ LocalTime.now().getSecond());
server.unicast("time","test",LocalTime.now().getSecond());
}
},0,1000);
}
2、客户端订阅接收
public static void main(String[] args) throws Exception{
//订阅服务
HproseClient client=HproseClient.create("tcp://127.0.0.1:4321");

    Thread thread=new Thread(new Runnable() {
        @Override
        public void run() {
            client.subscribe("time","test",(String msg)->{
                System.out.println(LocalDateTime.now()+"   "+msg );
            },String.class);
        }
    });
    thread.start();
}

现象:服务端看到订阅的客户端掉线
image

客户端接收日志
image

@NoNamesJavaDog
Copy link

NoNamesJavaDog commented Apr 17, 2022 via email

@andot
Copy link
Member

andot commented Apr 28, 2022

java 版本的不完善,像 golang、dotnet、typescript 这些都已经升级到 3.0 了,3.0 的推送已经很完善了。但是 java 语言本身太不思进取了,实在没精力把 java 版本的也升级到 3.0。等什么时候 java 支持 async/await 之后再看看吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants