code_cch 发表于 2017-12-26 09:03:24

关于subkey的问题


JSONObject product = new JSONObject()
                .put("product_key", PRODUCT_KEY)
                .put("auth_id", AUTH_ID)
                .put("auth_secret", AUTH_SECRET)   
                .put("subkey", subkey)
                .put("events", EVENTS);
                JSONArray products = new JSONArray().put(product);
                GizwitsNoti gizwitsNoti = new GizwitsNoti(products,
                new CallBack() {
                  public void call(JSONObject msg)
                  {
                          String cmd = msg.getString("cmd");
                   }
                }
给subkey传值时 第一次传123456 可以连接以及登录机智云,也能发送指令;第二次调用时subkey改为123458时就无法连接机智云了,其他值都不变。这是为啥? 我看api,subkey是消息分发机制的区分值,这么处理有啥问题求大神指点。

boboP 发表于 2017-12-26 10:15:11

登陆的时候,把服务端返回的消息贴出来看看

code_cch 发表于 2017-12-26 17:25:58

boboP 发表于 2017-12-26 10:15
登陆的时候,把服务端返回的消息贴出来看看

javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
        at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
        at sun.security.ssl.AppInputStream.read(Unknown Source)
        at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
        at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
        at sun.nio.cs.StreamDecoder.read(Unknown Source)
        at java.io.InputStreamReader.read(Unknown Source)
        at java.io.BufferedReader.fill(Unknown Source)
        at java.io.BufferedReader.readLine(Unknown Source)
        at java.io.BufferedReader.readLine(Unknown Source)
        at net.baojuxinxi.gizwits.platform.snoti.GizwitsNoti$ReceiveThread.run(GizwitsNoti.java:167)
只报这些

boboP 发表于 2017-12-27 10:17:12

code_cch 发表于 2017-12-26 17:25
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
        at sun.securi ...

这个是代码运行报错了吧,SSL的链接异常错误,我说的是服务端返回的消息
页: [1]
查看完整版本: 关于subkey的问题