JnrpeClient:java.net.SocketException:软件导致连接中止:recv失败

时间:2019-03-06 10:51:02

标签: java sockets socket.io nrpe jnrpe

nrpe代理工作正常,但是当在上面执行此代码时,我仍然收到此错误:java.net.SocketException:软件导致连接中止:recv失败

 try {
        JNRPEClient client = new JNRPEClient("192.168.121.129", 5666, false);
        client.setTimeout(30);
        ReturnValue ret = client.sendCommand("check_ping -H 192.168.121.129 -t 60 -w 3000.0,80% -c 5000.0,100% -p 5");
        System.out.println(ret.getMessage());
        System.exit(ret.getStatus().intValue());
    } catch (JNRPEClientException exc) {
        System.out.println(exc.getCause());
        System.out.println(exc.getMessage());

    }

1 个答案:

答案 0 :(得分:0)

将构造函数参数更改为true以启用SSL,并且应该修复 您的问题。

JNRPEClient client = new JNRPEClient("192.168.121.129", 5666, true);