0 Replies
      Latest reply on May 26, 2019 8:18 AM by Practician
      Practician Level 1 Level 1 (0 points)

        I am receiving the ETIMEDOUT when reading an InputStream (swift) after 60 seconds in a polling mode on a serial dispatch queue


        Stream.getStreamsToHost(withName: self.address, port: self.port, inputStream: &input, outputStream: &output)
        /// ....
        /// in an input stream extension
        let read = buffer.withUnsafeMutableBytes {
            self.read($0.advanced(by: validBufferBytes), maxLength: bufferSize)


        Now, I'm puzzled, as no documentation hints that this timeout will happen. It states that the call should block until there are bytes available.

        Also, I have searched high and low and it seems that I can't control this particular timeout.


        I have gone as far as querying the SO_RECVTIMEO socket option, but it looks like it's set to 0 as it should by default, meaning no timeout.


        What's happening? Can you please point to some authoritative information source on the actual behavior and ways to control it?