Post not yet marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
Post marked as unsolved with 4 replies, 0 views
Replied In
My Remote Mouse App using NWConnection.
I found a way to only send the current drag velocity in send.connection() by using the NWConnection.SendCompletion.contentProcessed handler but it still hasn't improved my latency issue on my iPhone. The mouse doesnt move that smoothly compared to when I run it on my iPad.
When I run it on my iPhone its always choppy. It moves smoothly for about 2 seconds, then it teleports a little further in the same direction. I check the latency duration on the connection.receive() and I noticed those first 2 seconds of smooth movement return durations of 13-17ms in the data transfer report and when it starts getting laggy/choppy it shows 0ms. This is collected from the DataTransferReport() in a connection.receive() call.
After this I said what if I don't send any data from my onDrag handler but only send constant data when the app starts? I made a function that sends some fake velocity Data through connection.send() every second and I still get some lag, but when I test that same function running on my iPad no lag.
Sending 1 data packet every second from iPhone 13 mini:
Sending 1 data packet every second from iPad Mini 6:
Also I noticed I get good network performance of my app when making a connection using the network interface awdl0 instead of en0, does anyone know why that might be? I know that en0 is the Wifi Interface and awdl is Apple's wireless direct link. Is because there's less interference on awdl0? The packets Im sending are very small.