【问题标题】:Akka Chat app for iOS适用于 iOS 的 Akka 聊天应用程序
【发布时间】:2018-09-15 08:44:39
【问题描述】:

我正在编写一个 iOS 聊天客户端。 服务器正在使用 (Akka) 和 java。

提供了要点击的网址: 例子: akka.tcp://ClusterSystem@efyduatio.XYZ.com:5222

我尝试在 Socket/WebSocket 中使用多种方式连接服务器:

var socket: SocketIOClient = SocketIOClient(socketURL: NSURL(string: "https://efyduatio.XYZ.com:5222")!)

var socket: SocketIOClient = SocketIOClient(socketURL: NSURL(string: "http://efyduatio.XYZ.com:5222")!)

var socket: SocketIOClient = SocketIOClient(socketURL: NSURL(string: "tcp://efyduatio.XYZ.com:5222")!)

var socket: SocketIOClient = SocketIOClient(socketURL: NSURL(string: "wss://efyduatio.XYZ.com:5222")!)

我无法连接到服务器,而 android 客户端有 Akka 库,并且相同的 url 连接完美。

【问题讨论】:

    标签: ios swift websocket socket.io akka


    【解决方案1】:

    使用SocketManager 而不是SocketClient

    guard let url = URL(string: "https://efyduatio.XYZ.com:5222") else { return }
    let manager = SocketManager(socketURL: url)
    let socket = manager.defaultSocket
    
    socket.on(clientEvent: .connect) {data, ack in
        // do stuff upon connection
    }
    
    socket.connect()
    

    【讨论】:

    • 函数 nw_protocol_boringssl_handshake_negotiate_proceed:第 387 行握手失败。断开会话。 TIC TCP Conn 失败 SURLSession/NSURLConnection HTTP 加载失败 (kCFStreamErrorDomainSSL, -9800)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-04-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-14
    • 1970-01-01
    • 2016-08-24
    相关资源
    最近更新 更多