title: No iOS socket frameworks can connect to server socket
body: <p>I'm trying to use a socket framework to connect to a socket I have. I am able to connect just fine with raw socket code like:</p>
  
  <pre><code>uint portNo = 9900;
  CFReadStreamRef readStream;
  CFWriteStreamRef writeStream;
  CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)@"123.456.789.159", portNo, &amp;readStream, &amp;writeStream);
  inputStream = (__bridge NSInputStream *)readStream;
  outputStream = (__bridge NSOutputStream *)writeStream;
  
  [inputStream setDelegate:self];
  [outputStream setDelegate:self];
  
  [inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
  [outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
  [inputStream open];
  [outputStream open];
  </code></pre>
  
  <p>but when I try with any framework I get an error and I'm completely stumped as to why. I've tried SocketRocket and Jetfire. Here's the code for connecting in SocketRocket that I've tried:</p>
  
  <pre><code>_webSocket.delegate = nil;
  [_webSocket close];
  
  _webSocket = [[SRWebSocket alloc] initWithURL:[NSURL URLWithString:@"wss://123.456.789.159"]];
  _webSocket.delegate = self;
  
  NSLog(@"Opening Connection...");
  [_webSocket open];
  </code></pre>
  
  <p>I've also tried with the port number added.</p>
  
  <pre><code>_webSocket = [[SRWebSocket alloc] initWithURL:[NSURL       URLWithString:@"wss://123.456.789.159:9900"]];
  </code></pre>
  
  <p>Also tried with http, https, ws. Still nothing.</p>
  
  <p>Anybody have an idea as to why?</p>