How (mulitcas/broadcast/fordward) data from a client to different Servers?

Sorry if the question does not have the proper terms. But basically, I have the following set up/problem:

  • A client in a remote computer that stream data (tcp) using a port, namely 3000.
  • In the other side, I have two computers (master and slave) .*This is a set up for a CAVE (switchboard + ndisplay). So they need synchroniyation.

The UE4 application Im trying to run is a server and listens to the client in the before mentioned port. The problem stars once I run switchboard because n instances of the UE4 application are created but just one can bind to that port, and in consequence the others instances dont get any data.

One solution i came with was to bind the server to differen ports and send data from client to those specific ports, but as data comes in different ticks the data is never sincronized.

In this sense, I looking for an advice or guidence about what to look for.

You need to stream in UDP for any sense of synchronization. TCP is strict about fragmented, lost and sequential packets. It will stall and re-request the data. Halting all other flow until the requested data is received. This is do to TCP’s sequential ordering.

With UDP you have to handle sequencing etc at the application layer. Essentially you have to build your own ACK processing.

UDP is the go to protocol for broadcast or multitask network transmission.

1 Like

While I, too, like UDP for real-time action, that doesn’t solve the problem that the server processes won’t all receive the same UDP packet stream. While it IS possible to bind multiple processes to the same UDP port number, only one of those processes will get any one incoming UDP datagram. (Unless it’s a broadcast datagram.)

I think the problem here is architecture – you’re trying to do something which probably isn’t the right way to do it. For example, if each of those processes is a display coordinator, then shouldn’t they each be a CLIENT, and then some other process should be the server, forwarding state to each of those processes?

1 Like

Almost sounds like an RCon setup where Client 0 is also host (Listen Server). I’m visualizing it like Player 0 is also the server admin. Player 1,2,3 etc are standard clients.

If this is the case, then TCP is fine for simple server command logic. If there’s real time “reaction” to clients 1,2,3, then UDP is needed.

1 Like

Thanks all for your responses. I have considered all possibilities (TCP → Server, multi client; UDP->MUlitcasting) and test each of them. After local testing, seems like UDP is gonna solve the syncronization and low latency problem that is my main issue so far. Today later on I will deploy in the CAVE check wheter it works.