Seems that NetMIDI disconnects if the iPad is left idle for more than about 10-15 minutes. All sleep modes are disabled on the iPad, and it is plugged into the charger. So the iPad does not sleep, but NetMIDI disconnects if no MIDI is transmitted for 10-15 minutes.
I have checked the wireless router and there are no power saving or sleep functions activated.
How do I stop this from happening?