An update to those reading this post: our problem was solved by updating to iOS 14.2.
Post
Replies
Boosts
Views
Activity
eskimo,
Thank you for your response.
We got an entitlement and now use it to no luck.
Here's what I have now on all my devices: Wipe iOS device, install app via TestFlight: doesn't work.
Then use TestFlight to roll back to a previous build that used the same codebase and didn't work as well: suddenly it will start working.
Update to the latest build: doesn't work again.
Next case:
4. Install development build via XCode - works.
5. After that, all TestFlight builds that didn't work start working. Until you wipe the device again.
If you take the Xcode archive that you use to submit to TestFlight and use the Organizer to export a Development signed build — this will give you a Release build that’s Development signed — what do you see? I got an .ipa that didn't work.
I changed code to use raw BSD sockets in the following way:
Creation code:
				mSocket = socket(AF_INET, SOCK_DGRAM, 0);
				if (mSocket < 0)
				{
						// Handle error
						...
				}
				struct sockaddr_in addr;
				memset(&addr, 0, sizeof(addr));
				addr.sin_family = AF_INET;
				addr.sin_port = htons(OnStageApp::cDiscoveryPort);
				addr.sin_addr.s_addr = INADDR_ANY;
				int result = bind(mSocket.load(), (const struct sockaddr *)&addr, sizeof(addr));
				if (result < 0)
				{
						// Handle error
						...
				}
Receive loop code:
				ssize_t len = recv(socket, (char *)buffer, cBufSize, 0);
				if (len == -1)
				{
						// Handle error
						...
				}
				std::string msg(buffer, len);
What I see is that creation passes without errors and recv is executed. But neither actual messages nor errors are received. Unless you run from XCode with development signing.
Currently the system is not requiring the multicast entitlement for BSD Sockets clients (although we expect that to change in the iOS 14.x lifecycle). Thank you, we are requesting the multicast entitlement then.
As to why your BSD Sockets code is not working, it’s hard to say for sure. Have you tried boiling this down to a small test
project? I have 2 apps, one uses boost::asio, another one uses Qt and QUdpSocket. Both are suffering. The case with Qt is already quite trivial:
		mUdpSocket = new QUdpSocket(this);
		connect(mUdpSocket, SIGNAL(readyRead()), this, SLOT(ProcessMessages()));
		connect(mUdpSocket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(OnError(QAbstractSocket::SocketError)));
		QHostAddress host = QHostAddress::Any;
		mUdpSocket->bind(host, App::cDiscoveryPort, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint);
... and on some of devices I neither get an error nor a message callbacks. External side is sending UDP broadcast messages every 2 seconds. The same code worked on the same devices in iOS 13.
What's notable is that it's a TestFlight build that fails, but dev build with development signing works fine. Are there any signing related differences?
We seem to be in a similar situation. Our apps use to receive broadcast UDP and they work intermittently with iOS 14 (worked fine with iOS 13). We do use BSD sockets in a form of boost::asio. Do we also need com.apple.developer.networking.multicast for broadcast receive to start working?