G
G
Gastline2019-05-14 10:27:26
Computer networks
Gastline, 2019-05-14 10:27:26

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

4 answer(s)
K
Kosyachoka, 2019-05-14
@Gastline

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

#
#, 2019-05-14
@mindtester

dotnet core rsigna l looked? if not, I recommend

A
asdz, 2019-05-14
@asdz

Probably you need to implement a server based on UdpClient

D
Denis Antonenko, 2019-05-15
@dabrahabra

Wow, first you need to deal with the flows)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question