It could be the network's fault. I'm running spacedesk on an android phone which is my secondary machine. The primary machine is a very old laptop but it's fully functional and working well. They are both connected to a same wireless network.
The reason I choose spacedesk is I need to run some online games on the background and I need to check them from time to time. I can't tell this error is due to my network or secondary machine, because the primary machine is working fine(the games is still running on background and not disconected) during android phone is disconnected. Today this phone is working with me. I don't know why this happened. Maybe I should try to update the system.
Anyway, thanks a lot for your help!
You can try different network connection to verify if this connection problem only occurs in wireless network.
Is your primary machine Windows 10 or Windows 7/8.1?
If it's Windows 10, you can try WiFi Direct / Mobile Hotspot on your Windows 10 primary machine instructions in our user manual https://spacedesk.net/user-manual#hotspot.
If it's Windows 7/8.1, you can try Hosted Network connection on your Windows 7/8.1 primary machine. https://spacedesk.net/user-manual#hosted-network
OR if your Android device supports USB tethering, you can use your USB cable to establish a private network connection between your primary machine and android device. https://spacedesk.net/user-manual#usb-tethering