Saturday, March 3, 2018

How does P2P work with multiple people?

I really want to know this. Let's say you have an 8 player game. Every player has a 1MB/s upload speed and 1MB/s download speed. The server has 8MB/s download speed and 8MB/s upload speed.

When everything would be done server-side, I think that one player would send it's data to the server, and the server would send it back to the other players with 1MB/s speed for each player. But I don't know how it'd work with P2P. Would each player upload the same data 8 times to every player, dividing their upload speed by 8? Or is there any other, more efficient way to do it?

Also, let's say you have a chat client. One user would be logged in, and the other would be logged out, with his client closed. The first user wants to send a message to the second one now, so that when he comes back he'd receive it immediately.

If it'd be sever-side, the message would be just sent to the database, so when the second user logs in, his client would automatically download this database and access this message. How would that situation work with P2P? There's not really any central database. How can you send something to someone when he's currently not using the network? Do you need to keep your PC turned on until the second user logs in? Or do you need to send the message in an encrypted form to other currently available users, and they'll send it back to the second user when he logs back in?



No comments:

Post a Comment