Answer the question
In order to leave comments, you need to log in
How to implement an asynchronous TCP C# server?
I started writing a game server, everything would be fine, but a problem arose, due to the fact that the load is planned to be more than 10k people and some data does not have time to be processed on the client side, then there are jerks or a general refusal to update data on clients, the logic of my server:
1. Connecting to server and sending to all clients about the connection.
2. Synchronization of positions (sent every time the player moves)
3. Reception of messages on the client side and interpolation of the old position to the new one.
I use BinaryWriter and BinaryReader for sending and receiving.
Link to the server: https://yadi.sk/d/ta5pmIFWe_nbwg
Please help me solve this problem or tell me which way to dig.
Answer the question
In order to leave comments, you need to log in
Has the new generation of creators of "their 10k mmo servers" grown up? :) well, ok
Tsr or udp is chosen mainly according to the criterion of how dynamic this "new epic saga" will be. If it's a shooter, then udp speed compensates for the quality. If it's "killer wow, l2" then tcp, it's important that the client's actions are delivered from and to the server. And then, of course, the most difficult thing is not to quit this business after a month, remaining without progress and observing lags and glitches. To make the game smooth, you will have to make adaptive logic that will take into account network delays both on the client and on the server. The easiest way is to first make a client that will run independently of the server, and then gradually add server-side control there step by step, hone the movement,
In general, you are not the first, you are not the last. Looking forward to a masterpiece. If I'll be ten thousand the first player ;)
PS on the topic :) . look towards architecture based on packets and queues. Only in this way will you build a scalable client-server relationship that will not die from 20 simultaneous connections
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question