title: Swift 3 Socket Issue
body: <p>I am writing a very simple socket based command line tool in Swift 3, but my streams are not calling the delegate methods. For example, when I check if bytes are available, there are bytes available but the delegate method has not been called. Here is my connection code:</p>
  
  <pre><code>func connect() {
  
      print("Socket Connection")
  
      let ipAddress = "127.0.0.1" as CFString
  
      let portNumber: UInt32 = 8080
  
      var readStream:  Unmanaged&lt;CFReadStream&gt;?
      var writeStream: Unmanaged&lt;CFWriteStream&gt;?
      CFStreamCreatePairWithSocketToHost(nil, ipAddress, portNumber, &amp;readStream, &amp;writeStream)
  
      self.inputStream = readStream!.takeRetainedValue()
      self.outputStream = writeStream!.takeRetainedValue()
  
      self.inputStream?.delegate = self
      self.outputStream?.delegate = self
  
      self.inputStream?.schedule(in: RunLoop.current, forMode: RunLoopMode.defaultRunLoopMode)
      self.outputStream?.schedule(in: RunLoop.current, forMode: RunLoopMode.defaultRunLoopMode)
  
      self.inputStream?.open()
      self.outputStream?.open()
  }
  </code></pre>