Skip to content

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

@byxkp

Description

@byxkp

场景复现:
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions