Simple iOS App with Foundation InputStream and OutputStream...


bap04e@...
 

All,


I created a simple iOS app to connect to a server and receive a message. I am doing this as an example app using InputStream, OutputStream, and StreamDelegate. The Server is a simple Java app running on my MacBook Pro. The iOS app is running on my iPhone 7. I use the address of my laptop on the local network and the port the Java app is listening on (xxx.xxx.xxx.xxx:ppppp) in the URL object. Despite this, my InputStream and OutputStream objects are nil after calling their initializers. If I use netcat in terminal I can connect to the server. But my running iOS app cannot. Is there something missing in the iOS app that I need, like a permission of some sort?

Join cocoa@apple-dev.groups.io to automatically receive all group messages.