I need to make a multi-user chat in C # (one server, many clients), explain the principle of which classes to use, how to memorize users and how to send messages to everyone (if one client wants to send a message to another client)

THANK!

Shl. I tried using tcpclient and TcpListener, but here the server can only receive messages from users, and I don’t know how to send them back or everyone

2 I did not ask the air to decide everything for me, I need to find out how it works inside and by what means do it myself. I have 2 projects: server and client, server (Tcplistener) accepts requests from clients (Tcpclient), be it just a connection or regular messages, there may be several clients: if one client wrote a message, only the server sees it, how to make it visible all clients or some specific

2fori1ton Thank you

  • @Pavel Petrov, According to the rules of the forum, questions should not be reduced to the decision or the completion of student assignments. Please clarify what you have done yourself and what did not work out. - Sofver
  • You need to think about what entities will participate in the process and start writing code that implements their functionality. For some reason, many people think that for each task there is a list of classes that only the guru knows. - nitrocaster

2 answers 2

  1. Simple TCP Server Example
  2. Detailed MSDN Documentation

    Try to use this project as a point of reference.