• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Permission Denied trying to connect to localhost in unit test
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Permission Denied trying to connect to localhost in unit test


  • Subject: Re: Permission Denied trying to connect to localhost in unit test
  • From: Jens Alfke via Cocoa-dev <email@hidden>
  • Date: Thu, 12 Dec 2019 10:58:23 -0800


> On Dec 12, 2019, at 7:42 AM, Robert Walsh via Cocoa-dev
> <email@hidden> wrote:
>
> I am writing a command line application in Objective-C that needs to make a
> TCP connection to a server.  In a unit test for the TcpClient class I am
> writing, I have a simple TCP server that listens for connections in a thread.
>  When I try to connect to this socket from the client socket class, connect()
> fails and perror reports Permission Denied.

That's odd. I've written plenty of macOS networking code and not seen this
problem. What is the errno value?

The only thing I can guess is that the Xcode test-runner process is being
sandboxed to prevent outgoing networking, but I've definitely run TCP
connections from XCTests without problems. Are you connecting to "localhost" /
127.0.0.1, or using an explicit IP address?

—Jens
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Permission Denied trying to connect to localhost in unit test
      • From: Alex Zavatone via Cocoa-dev <email@hidden>
    • Re: Permission Denied trying to connect to localhost in unit test
      • From: Robert Walsh via Cocoa-dev <email@hidden>
References: 
 >Permission Denied trying to connect to localhost in unit test (From: Robert Walsh via Cocoa-dev <email@hidden>)

  • Prev by Date: Permission Denied trying to connect to localhost in unit test
  • Next by Date: Re: Future of Cocoa #2
  • Previous by thread: Permission Denied trying to connect to localhost in unit test
  • Next by thread: Re: Permission Denied trying to connect to localhost in unit test
  • Index(es):
    • Date
    • Thread