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: Alex Zavatone via Cocoa-dev <email@hidden>
- Date: Fri, 13 Dec 2019 11:49:15 -0600
Is it an https/http error?
On iOS, we have to add an exception in the info.plist for ATS (Application
Transport Security) to allow http traffic.
Is there anything similar on the Mac?
Sent from my iPhone
> On Dec 12, 2019, at 12:58 PM, Jens Alfke via Cocoa-dev
> <email@hidden> wrote:
>
>
>
>> 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
_______________________________________________
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