Writing C # Client / Server

I would like to write a C # server that will act something like a chat server (clients have been connected for a while, one message can be sent to many clients, ....).

I was wondering if you can give me some hints for a start (what kind of architecture (client streams / iocp / asynchronous / ...) that will scale well (should be able to handle thousands of simultaneous connections)).

+4
source share
4 answers

Here is a tutorial to help you get started well.

It seems to be using a threaded implementation, so it should scale well.

Creating a chat server and chat client

+2
source

Here is an example of using WCF: http://www.codeproject.com/KB/WCF/WCFWPFChat.aspx

I hope you don't have to deal with raw sockets using WCF, it would be interesting to see if WCF can handle thousands of connections, though ...

+2
source

If you need the scalability you are talking about, IOCP is the only way to go.

There are some pitfalls to avoid, so read my detailed answer to: How to write a scalable Tcp / Ip server in combination with the accepted answer to the same question.

+1
source

This might be a good place to start: http://www.dreamincode.net/forums/showtopic33396.htm

0
source

Source: https://habr.com/ru/post/1285819/


All Articles