We are trying to get two programs to communicate with each other in a game-like fashion. They maintain a TCP connection with a central server for "control" type information, which that central server ensures both clients receive. The two clients then communicate with a udp server using sendto() and recvfrom() which just sends the information it receives to the other client connected.
Now, the problem is that, if you have a home router or private office network, the udp server sendto() to the other client will be filtered out by the firewall, unless you have a port opened, which is way more than we want our customers to do.
But I don't want to lose the benefits of UDP — I don't care about packet loss and order. I am willing to manage all that myself.
So, can I reliably create a read-write connected UDP socket? I recall trying this in the past, and just having so many problems that I gave up and went to the sendto() - recvfrom() solution, before realising that I'd just screwed myself outside of our private network.
Any suggestions for how to deal with this? Any best practices or things I should pay particular attention to for connected UDP sockets? Is it really even feasible?
(I'm coding this all in pure C).