Good day! There was a need to implement your own multithreaded server class (with # or VB .NET - not yet decided) for further use in your projects. There seems to be a lot of material on the Internet, but questions remain. I’m looking for answers to them: I see the work scheme as follows: Create a new class and start the server in it, the class generates three events (pseudo-code):
- подключилсяКлиент(клиент,данные) - отключилсяКлиент(клиент) - новыеДанныеОтКлиента(клиент,данные) The class holds information about each client in the form of a client class, which stores its number on the server, IP and so on. There may be many customers
The question is how to implement the work flow in this class. For example, when a message arrives, I want to safely create an event to transfer the above objects to it (so that from the parent class this data could only be used without unnecessary hemorrhoids associated with the flow). And how to work with server threads from the parent class? For example, the server has a send(клиент,данные) method send(клиент,данные) . How to implement? It is possible in c # or just the essence is better. I apologize for the illiteracy in this area. Before that, I worked only with the finished library, but it significantly limits me.