خرید بک لینک

Vote count: 0

I am using Starscream to open up a websocket. The problem is that it does't coect on localhost or with the server.

var socket = WebSocket(url: NSURL(string: "ws://localhost:8080/")!)
self.socket.voipEnabled = true;
        socket.delegate = self
        socket.coect()
 func websocketDidCoect(ws: WebSocket) {
        print("websocket is coected")
    }

    func websocketDidDiscoect(ws: WebSocket, error: NSError?) {
        print("websocket is discoected: (error?.localizedDescription)")
    }

    func websocketDidReceiveMessage(ws: WebSocket, text: String) {
        print("Received text: (text)")
    }

    func websocketDidReceiveData(ws: WebSocket, data: NSData) {
        print("Received data: (data.length)")
    }

    func websocketDidReceivePong(socket: WebSocket) {
        print("Got pong!")
    }

    @IBAction func writeText(sender: UIBarButtonItem) {
        socket.writeString("hello there!")
    }

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 17 ارديبهشت 1395 ساعت: 20:43

صفحه بندی