8 Replies
      Latest reply: Mar 27, 2017 1:29 AM by eskimo RSS
      sujan kota Level 1 Level 1 (0 points)

        defaultPath in NEProvider can be used for only connection created by createTCPConnectionToEndpoint/createUDPSessionToEndpoint ? Or for any TCP connection created by custom code.

        • Re: defaultPath in NEProvider
          eskimo Apple Staff Apple Staff (7,485 points)

          While it’s recommended, the NEProvider architecture does not require you to use the NWTCPConnection API.  The docs for createTCPConnection(to:enableTLS:tlsParameters:delegate:) say:

          This method provides a convenient way to create TCP connections from a Network Extension Provider. It is preferred over using the sockets API.

          which indicates a preference, not a requirement.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

            • Re: defaultPath in NEProvider
              sujan kota Level 1 Level 1 (0 points)

              Thanks for your response eskimo.

               

              Yes, It's working as mentioned. However, isEqualToPath provide by NWPath returns false eventhough the new and old paths are same.

               

              NWPath - newpath -
                  status = satisfied
                  reasonCode = 0
                  reason = Path is satisfied
                  clientID = D34CF87E-343E-4AAE-8F66-6CE98E795AB2
                  isExpensive = YES
              
              NWPath - oldpath -
                  status = satisfied
                  reasonCode = 0
                  reason = Path is satisfied
                  clientID = D34CF87E-343E-4AAE-8F66-6CE98E795AB2
                  isExpensive = YES