CocoaAsyncSocket is about my favourite library, but we've found a horrible problem -- either in AsyncSocket, or, perhaps the underlying.
The problem is described at length here:
You can play a video here .. http://www.mediafire.com/?rie4xpeeptgemvo
or download a full demo here:
http://www.mediafire.com/?a1cnkodxd5mna6c
in short, performance is hideous with an iPodTouch4 as a client .. nothing else!
You can use either iPad, or any gen phone, etc, as a client, and it works flawlessly.
How could this be?
If you have an iPodTouch4, check it out.
Thanks for any ideas,
Fat Johnnie
--
You received this message because you are subscribed to the Google Groups "CocoaAsyncSocket" group.
To post to this group, send email to cocoaasy...@googlegroups.com.
To unsubscribe from this group, send email to cocoaasyncsock...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cocoaasyncsocket?hl=en.
In brief..
(*) I will try the Nagle aspect now, thank you
(*) iOS versions: the problem exhibits with all iOS versions we have on hand. With 4.3.3 (latest), same results
(*) I have a shortage of iPhone4 for testing: I do not know decisively if the problem shows with iPhone4. We have piles of everything else and (other than my lack of iPhone4s!) it's only the iPodTouch4
Anyway I will alert asap on Nagle......
WIth great thanks,
Fat Johnnie
(1) I did try non-Nagling on both client and server, it does not affect the issue.
{As an unrelated point .. I have to believe if you are working with real-time connections, surely it's generally better to disable the Nagle algorithm? So thanks for that.}
(2) I have discovered that this is related to the HORRIBLE BLUETOOTH BUG.
The demo app I posted 100.0%, exhibits the HORRIBLE BLUETOOTH BUG every single time:
(a) if you turn Bluetooth ON on the client device: the connection does not work 100% of the time
(b) if you turn Bluetooth OFF on the client device: the connection does work flawlessly 100% of the time
(3) I believe there is a still a specific problem WRT the iPodTouch4Gen: I will keep researching this.
(4) To fix the Horrible Bluetooth Problem:
Is the solution: making sure the CLIENT uses ONLY wifi (strictly not Bluetooth)?
Does anyone know if this is correct, and possible?
Essentially, do I follow the example in InterfaceTestAppDelegate.m, using -(NSData *)wifiAddress and then the amazing new connectToAddress: method?
Or ........................ is one still buggered, merely by the fact that power is On to the Bluetooth antenna?
Thank you in advance if anyone knows.
Since real-time-CAS-networking does not work on iOS if Bluetooth is present, this problem must come up often I guess?? I am very, very sorry if I wasted anyone's time by repeating this issue.
Very kindly,
Fat Johnnie
SMHK
On 7 May 2011, at 05:38, Robbie Hanson wrote:
> The problem is described at length here:
>
> http://stackoverflow.com/questions/5917426/horrible-ipodtouch4-specific-networking-problem-demo-app-video
Best,
Eiko
(1) It turns out the primary problem is the dreaded "does not work if Bluetooth is turned on" problem.
(2) I tried non-Nagleing as described by R.H. -- sadly, no difference.
(3) Next, I am trying to specify WiFi-only, using connectToAddress:
(it's a nuisance to convert hostname and port to a sockaddr structure)
I will report back on the results of (3) !!!
The demo is quite useful, and you can get it here.. http://www.mediafire.com/?a1cnkodxd5mna6c
Kindly
Fat Johnnie
You are right. I tried using 'connectToAddress' and specifying en0 so that only the ethernet is used for certain.
However, it makes absolutely no difference to the problem.
In retrospect, this makes sense: the problem seems to be basically interference from the Bluetooth antenna. The client-server was already using WiFi for sure (simply turn off BT on the server), so enforcing WiFi would make no difference -- it does make no difference.
I will try GCDAsyncSocket as you suggest. It sounds like it is not a fix though.
I am really mystified because: there DO EXIST one or two iPhone games, that allow a solid realtime WiFi connection ... even if the user leaves Bluetooth running.
On 7 May 2011, at 15:21, Shukuyen wrote:
> Hi,
> I posted to this group with this problem too, some time ago.
> I tested with wifi only (using the added connect via interface
> method), but that didn't help. The problem appeared on iPhone 3G, 3GS
> and 4.
> My solution was to switch to GCDAsyncSocket, this has improved things
> quite a lot. It is not perfect yet (about 50/50 chance) but better
> than before.
> Bye,
> Shukuyen
AsyncSocket does not work.
AsyncUdpSocket does not work.
AsyncSocket, with Nagling off does not work.
AsyncSocket using the new interface forcing does not work.
GCDAsyncSocket does not work.
In each of the five cases, it fails if the user has Bluetooth running on their device.
I can only say "WTH" ?!?
How the heck DOES one do realtime networking on iOS devices??!
- Fatty