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

SocketManager.init failing with config options

Open cbiggin opened this issue 5 years ago • 9 comments

The following code fails on v15.1.0:

self.manager = SocketManager.init(socketURL: url, config: [.log(true), .compress])

If you eliminate the config options, then it works. The above works under v15.0.0.

cbiggin avatar May 29 '19 16:05 cbiggin

What does it fail with?

nuclearace avatar May 29 '19 17:05 nuclearace

The following is working as well:

self.manager = SocketManager.init(socketURL: url, config: [.compress])

So it looks like it's the .log option.

cbiggin avatar May 29 '19 17:05 cbiggin

Screen Shot 2019-05-29 at 1 08 47 PM

cbiggin avatar May 29 '19 17:05 cbiggin

That's a bit strange... and also a little unhelpful. Does it print anything? Are you running this is in a debug config or a release.

nuclearace avatar May 29 '19 17:05 nuclearace

Also, have you done a fresh install/compile? I'd include a CocoaPods refresh as part of that, if CocoaPods is involved.

nuclearace avatar May 29 '19 17:05 nuclearace

Nope, not printing anything. And yes, running it in debug config. Also failing on both simulator and device. Using Carthage.

Just created a small project and that seems to initialize fine so will delve deeper.

cbiggin avatar May 29 '19 17:05 cbiggin

One thing to note, nothing in this library is thread safe. So if you had some concurrent access violation happening, that could cause it.

nuclearace avatar May 29 '19 17:05 nuclearace

Hi, i was running into the same problem, my setup is identical to @cbiggin post above https://github.com/socketio/socket.io-client-swift/issues/1200#issuecomment-497036884 ; removing the .log option from SocketIOClientConfiguration seems to help for now

sbachmannlp avatar Sep 26 '19 09:09 sbachmannlp

Encountered same issue, with no log or anything. Xcode debug stops with EXC_BAD_ACCESS(code=1, address=0x0) at SocketIO.SocketManager.init(socketURL: Foundation.URL, config: SocketIO.SocketIOClientConfiguration) -> SocketIO.SocketManager

Xcode: 13.4.1 Podfile: pod 'Socket.IO-Client-Swift', '~> 16.0.0'

abmomen avatar Jun 26 '22 07:06 abmomen