1

I have a C# desktop app and a C# Server console app.

The C# desktop client app uses WebSocket4Net and my C# server app uses Fleck.

Am I right in assuming that it uses TCP protocol. If so, can I get it to use UDP protocol?

The reason I asking this is because I read TCP is slower than UDP because TCP ensures order of packets.

I read this from this article:

Making Fast-Paced Multiplayer Networked Games is Hard

wonea
  • 4,783
  • 17
  • 86
  • 139
Andrew Simpson
  • 6,883
  • 11
  • 79
  • 179
  • @Amit Hi, thanks for showing an interest. My client uses the WebSocket4Net framework and my Server uses Fleck. Would I be better not using this at all and just code my own udp socket connection? – Andrew Simpson Sep 02 '15 at 13:37
  • [Websockets use TCP](http://stackoverflow.com/questions/16945345/differences-between-tcp-sockets-and-web-sockets-one-more-time). Why do you want them to use UDP? – CodeCaster Sep 02 '15 at 13:37
  • @CodeCaster HI, good question. My app/system needs to upload real-time data. I read on this article http://www.codeproject.com/Articles/1023864/Making-Fast-Paced-Multiplayer-Networked-Games-is-H that UDP is faster than TCP but does not guarantee order of packets. If I 'skip' the missing packets on my server I am hoping to get a better FPS. Just doing R&D really – Andrew Simpson Sep 02 '15 at 13:39

1 Answers1

6

No, WebSockets are based on TCP which in turn is based on IP. UDP is also based on IP, but doesn't have anything to make sure the packets arrive in order or arrive at all. UDP just throws packets at a remote endpoint in the hope someone catches it. It's connectionless, so impossible to use UDP with WebSockets.

Philippe Paré
  • 4,279
  • 5
  • 36
  • 56