FreddiChat is a simple chat client and server solution written in C# using WCF (client, server) and WPF (client). It uses NetNamedPipeBinding, NetTcpBinding or WSDualHttpBinding for connections. It's minimalistic in its looks and its interaction patterns are rather similar to mIRC or other channel based clients. FreddiChat however only provides one channel per server.
- Connect to any server using desired name (type
/connect user host
) - Broadcast messages to all users
- Whisper message to specific user (double-click desired name or type
/w user
) - Reply to last received whisper (type
/r
) - Links are automatically marked up and clickable
- History of previous commands or messages (use up and down arrow keys)
- Clear chat history (type
/clear
) - Disconnect from server (type
/disconnect
) - Quit at any time (type
/quit
)
The source consists of two projects.
- FreddiChatClient is a WPF application, which provides the user with an interface to connect to servers and chat with other users.
- FreddiChatServer is a console application, which provides a chat service. It displays relevant calls to and operations of the server, providing very limited interaction and configuration.
Follow the steps below to build the server and the client.
- Open
FreddiChat.sln
inVisual Studio
- Select
Build Solution
to build the server and the client - Browse to
FreddiChat\ChatServer\bin\Debug
and executeFreddieChatServer.exe
to start the server- Select
net.pipe
as protocol when prompted - Select
localhost
as hostname when prompted
- Select
- Browse to
FreddiChat\ChatClient\bin\Debug
and executeFreddieChatClient.exe
to start a client- Type
/connect Anonymous net.pipe://localhost
to connect
- Type
- Named Pipe using the
NetNamedPipeBinding
, e.g.net.pipe://localhost/FreddiChat/
- TCP using the
NetTcpBinding
, e.g.net.tcp://localhost/FreddiChat/
- HTTP using the
WSDualHttpBinding
(a port must be specified), e.g.http://localhost:8080/FreddiChat/
Warning: No security is applied for connections.
Security mode None
is used. Anyone can access the service and messages are not encrypted.
The service client is generated using the ServiceModel Metadata Utility Tool (svcutil.exe
). It must be regenerated when changing the service contracts.
Follow the steps below to regenerate the service client.
- Open
FreddiChat.sln
inVisual Studio
- Right-click the
FreddiChatServer
project and selectBuild
to build the server - Browse to
FreddiChat\ChatServer\bin\Debug
and executeFreddieChatServer.exe
to start the server- Select
net.pipe
as protocol when prompted - Select
localhost
as hostname when prompted
- Select
- Start
Developer Command Prompt
forVisual Studio
- Execute
svcutil.exe /language:cs /noConfig /namespace:*,FreddiChatClient.Communications /out:FreddiChat\ChatClient\Communications\GeneratedChatServiceClient.cs net.pipe://localhost/FreddiChat/mex
to regenerate the service client
To prevent the Visual Studio
debugger from breaking on LoadFromContext occurred
and NotMarshalable occurred
, disable the Enable UI Debugging Tools for XAML
option in Tools > Options > Debugging > General
.
FreddiChat is written by FreddieBoi. See the LICENSE file for license rights and limitations (BEER-WARE).