Coder Social home page Coder Social logo

xuancai / freddichat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from freddieboi/freddichat

0.0 3.0 0.0 855 KB

FreddiChat is a simple chat client and server solution written in C# using WCF and WPF. It uses NetNamedPipeBinding, NetTcpBinding or WSDualHttpBinding for connections.

License: Other

C# 100.00%

freddichat's Introduction

FreddiChat

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.

Features

  • 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)

Implementation

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.

Getting started

Follow the steps below to build the server and the client.

  1. Open FreddiChat.sln in Visual Studio
  2. Select Build Solution to build the server and the client
  3. Browse to FreddiChat\ChatServer\bin\Debug and execute FreddieChatServer.exe to start the server
    • Select net.pipe as protocol when prompted
    • Select localhost as hostname when prompted
  4. Browse to FreddiChat\ChatClient\bin\Debug and execute FreddieChatClient.exe to start a client
    • Type /connect Anonymous net.pipe://localhost to connect

Modes

  • 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/

Security

Warning: No security is applied for connections.

Security mode None is used. Anyone can access the service and messages are not encrypted.

Code generation

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.

  1. Open FreddiChat.sln in Visual Studio
  2. Right-click the FreddiChatServer project and select Build to build the server
  3. Browse to FreddiChat\ChatServer\bin\Debug and execute FreddieChatServer.exe to start the server
    • Select net.pipe as protocol when prompted
    • Select localhost as hostname when prompted
  4. Start Developer Command Prompt for Visual Studio
  5. 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

Debugging

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.

Build status

Build status

License

FreddiChat is written by FreddieBoi. See the LICENSE file for license rights and limitations (BEER-WARE).

freddichat's People

Contributors

freddieboi avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.