1
\$\begingroup\$

hi guys i made a server and client for mmorpg game of course very amateurish. i am using UDP to send coordinates if the packet is lost doesnt matter i am already sending 10 times in a second. UDP doesn't slow down server and server doesn't slow down other clients. But i also want to use TCP for ID PW and attack skill because when i use attack skill he needs to go absolutely to server. If i use TCP for them, Will client1 slow down Server ? or Will Server slow down other clients ?

i am using c++,opengl,SDL 1.2 and SDL_net 1.2

I will be grateful for your help :)

enter image description here

EDIT I ADD VIDEO :D : youtu.be/J7Ulh4vUBu0 when only udp server loop 658982 in a second like at the end of the video if i add tcp this valuse slow down ?

\$\endgroup\$
  • \$\begingroup\$ At a low level, if you're using blocking sockets, a malicious or slow client will cause issues with your server. If you're using non-blocking sockets then your server can continue to do things even if a client hasn't responded (which is good in your case because it needs to continue to simulate the game!). At a higher level, your game code should probably make sure that if the client gives intent to do something, you aren't waiting for a client response to pull the trigger. Move as much logic as you can to your server. \$\endgroup\$ – Coburn Aug 18 '17 at 16:54
  • \$\begingroup\$ Never even consider TCP for MMOs. \$\endgroup\$ – Almo Aug 18 '17 at 17:13
  • \$\begingroup\$ thanks your answers but i didn't understand completely i think i need to search blocking sockets and non blocking sockets :D \$\endgroup\$ – Emre Kaya Aug 18 '17 at 17:31
  • \$\begingroup\$ youtu.be/J7Ulh4vUBu0 when only udp server loop 658982 in a second like at the end of the video if i add tcp this valuse slow down ? \$\endgroup\$ – Emre Kaya Aug 18 '17 at 17:45
2
\$\begingroup\$

TCP is generally viewed as being slow because of the guarantee of delivery, and the guarantee of delivery in order. When the packet is not received, it has to be resent. It seems that the delay to resend the packet is implementation dependant. If a packet is missing, the software will have to wait for that packet to continue it's process, even if the following packets have arrived.

This represents a potentially high delay.

So to answer your question: I guess it depends on how you implement your transmission layer (blocking vs non-blocking sockets), and I think this is independent of whether you used TCP or UDP.

The TCP vs UDP is not about slowing down the server or the client, it's about having the user experience lag or not.

IMHO, you could use TCP for ID and PW if you want, but I'd suggest to find another way using UDP to transmit your attack commands.


Disclaimer: I'm not an expert on the topic, I've just been reading a lot on it lately.

\$\endgroup\$
  • \$\begingroup\$ thanks your answers but i didn't understand completely i think i need to search blocking sockets and non blocking sockets :D \$\endgroup\$ – Emre Kaya Aug 18 '17 at 17:31
  • \$\begingroup\$ Yeah, blocking sockets are bad :P \$\endgroup\$ – Vaillancourt Aug 18 '17 at 17:32
  • \$\begingroup\$ i will upload youtube my project and i will show what i want let me 5 10 min \$\endgroup\$ – Emre Kaya Aug 18 '17 at 17:37
  • \$\begingroup\$ youtu.be/J7Ulh4vUBu0 when only udp server loop 658982 in a second like at the end of the video if i add tcp this valuse slow down ? \$\endgroup\$ – Emre Kaya Aug 18 '17 at 17:44
  • \$\begingroup\$ What is that value? \$\endgroup\$ – Vaillancourt Aug 18 '17 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.