socket.io-client-swift icon indicating copy to clipboard operation
socket.io-client-swift copied to clipboard

Request time out

Open binitvermanigspann opened this issue 1 year ago • 0 comments

Hi,

I'm experiencing a "request timeout" issue when trying to connect to localhost using Socket.IO.

However, the connection works perfectly fine with Telnet and when using input/output streams.

The problem seems to be isolated to Socket.IO.

Socket Version: 15.2.0

ERROR SocketEnginePolling: The request timed out. ERROR SocketEngine: The request timed out. ERROR SocketManager: The request timed out.

Code:

let socketManager = SocketManager(socketURL: URL(string: "http://localhost:8000")!, config: [.log(true), .compress])
let socket = socketManager.defaultSocket

socket.on(clientEvent: .connect) { data, ack in
    print("Socket connected")
}

socket.on(clientEvent: .disconnect) { data, _ in
    print("Socket disconnected")
}

socket.connect()

Any suggestions on how to resolve this?

binitvermanigspann avatar Oct 03 '24 07:10 binitvermanigspann