iOS Framework Starscream can't connect when on device

498 Views Asked by At

I created a test app to connect using web sockets using the Starscream framework. It connects just fine on the simulator, but when I try it on the actual device, it fails and I get this error:

2017-07-26 08:59:01.638479-0700 poc[1769:361206] error = The operation couldn’t be completed. Connection refused
2017-07-26 08:59:01.638593-0700 poc[1769:361206] error = Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}

I've tried disabling ATS, setting self signed to true, using public keys or Apple provided certs. Still the same error.

Shot in the dark here basically. Has anyone encountered this or have I just failed to setup the framework correctly?

1

There are 1 best solutions below

0
On

You should definitely consider "re" operation, like "reconnect". Sometimes it takes like 5 seconds to connect.