Re: Permission Denied trying to connect to localhost in unit test
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