Simple TCP chat using Sockets (.NET).
Encoded using Huffman coding.
Sockets are initialized through a single Server and multiple Client executables.
Huffman tree generator input is generated during Server setup (check AppConstants.cs in HuffChat.BLL project).
First Server response to the Client is the Huffman generator input needed for sending encoded and decoding incoming messages.
First, start the server from the solution root directory (\HuffChat):
dotnet run --project HuffChat.Server
After the server is initialized, you can start one or multiple clients:
1.1 Default - host machine, automatically linked to the above Server
dotnet run --project HuffChat.Client
1.2 Define Client connection using params
- {y...} values represent the port
- {x...} values represent the IP address
- {displayName} is the name shown before each message (random if not provided)
dotnet run --project HuffChat.Client {xxxx::xxxx:xxxx:xxxx:xxxxxx} {yyyyy} {displayName}
Found in:
- \HuffChat\HuffChat.Server\bin\Release\net6.0 and \HuffChat\HuffChat.Client\bin\Release\net6.0 or
- \HuffChat\HuffChat.Server\bin\Debug\net6.0 and \HuffChat\HuffChat.Client\bin\Debug\net6.0
Runs 2 instances - 1 Server and 1 Client. Both will be connected to host machine.
Server with 3 connected Clients.
Testing messaging and disconnects.
sockets-chat-stable-demo.mp4
IDEs: Visual Studio 2022
Frameworks: ASP.NET Core