SwiftSocket icon indicating copy to clipboard operation
SwiftSocket copied to clipboard

Default iOS example doesn't read anything (-1)

Open reillychase opened this issue 8 years ago • 3 comments

Hi I am new to iOS working on my first app, sorry if this is my lack of understanding but it appears the default example returns -1 instead of apple.com HTML.

I want to make an app which reads RAW TCP from a chat server, I'm not sure if this library or any iOS library can work with RAW sockets, let me know if you have ideas there.

Thanks

reillychase avatar Aug 28 '17 20:08 reillychase

You might try setting a timeout in the client.read function, seemed to work for me:

guard let response = client.read(1024*10 , timeout: 2000) else { return nil }

rke246 avatar Sep 13 '17 20:09 rke246

I believe this issue is only occurring in v2.0.2. The iOS example runs as expected in all previous versions.

nathjwhite avatar Sep 14 '17 20:09 nathjwhite

@rke246 that fixed it. Thanks!

reillychase avatar Nov 03 '17 16:11 reillychase