You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
# MultiThreadTCP
|
|
|
|
|
|
|
|
|
|
- [Reference](https://codinginfinite.com/multi-threaded-tcp-server-core-example-csharp/)
|
|
|
|
|
|
|
|
|
|
## Explanation
|
|
|
|
|
- `StartListener` method keeps listening for incoming connections & every time when a new client gets connected
|
|
|
|
|
- It creates a new Thread of `HandleClient` to handle the connected client in the background
|
|
|
|
|
- Concurrently, server start waiting for another new client.
|
|
|
|
|
- For client, there is 2 distinct clients connecting to the same server.
|
|
|
|
|
- Each client will send and receive message for 3x in interval of 2s
|