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. I've added NSLog statements to show that the server thread is up and ready to accept connections before the client socket attempts to connect. Both the server and the client are using plain UNIX-style sockets.
In the same project, I have a similar test case that creates a UDP server that broadcasts messages, and the class being tested by that test case is able to receive those messages. Also, if I modify the test for the Tcp Client to simply let the server run for 30 seconds, I can connect to it with Telnet (running unprivileged within Terminal). My operating system is Mojave, and I created the project in XCode (v11.3) using the Command Line Tool template. I then added a target using the Unit Testing Bundle to create the unit tests. Does anyone know what I might need to do to get this working? Thanks! Rob Robert Walsh EnvisionWare, Inc. https://urldefense.proofpoint.com/v2/url?u=http-3A__www.envisionware.com&d=DwICAg&c=Hw-EJUFt2_D9PK5csBJ29kRV40HqSDXWTLPyZ6W8u84&r=7HfFKYLGy6JUsVAPU3WxTfVie1cWFsdczD8_5y5GIaI&m=642vWEaDVis2OUtoi0TXAyQFjdCmGuXd5gxB36sniKQ&s=1MHPcFZn0JHvqMRut8lGdNl8jPKm7iXYVKPlzWWyCbI&e= _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com