Search code examples
c++network-programmingtcpenet

TCP vs Enet for online card game with lobby?


I'm working on an online turn based card game for the PC. It features a lobby which will automatically update the list of active games so I'll be sending many updates to many clients. I will have a game server for this. Lag is not too big a deal for me, if players have to wait an extra 1/4 second sometimes until their card is shown, it dosn't really concern me. What concerns me is reliability and stability. I want to be able to host many 4 player games, I also allow people to watch a specific game too.

I also will need to log them in, and remember their session if they disconnect so they can get back in the game if they get disconnected.

What I am debating is if I should go with Enet which is UDP based with reliability, or plain old TCP/IP.

I will eventually need to be able to send them additional content created such as extra decks which will be in the form of a zip file. But for that I'm sure there is a library that could help me get these from an HTTP source.

If anyone has experience with either or both of these, I'd appreciate your input.

Thnks


Solution

  • I'd stick with classic TCP, not some library that has hacked in correct ordering and packet delivery reliability into a protocol not designed for it.

    Enet's claim is to have a few of the benefits of TCP, while delivering speed for "real-time" games. That phrase makes me think of FPS, which isn't your app at all.