Giter VIP home page Giter VIP logo

flecktest's Introduction

FleckTest

A little chat console program to test Fleck websockets library and IoC with Microsoft Dependency Injection library, developed in C# using .NET Core 3.1.

FleckTest.jpg

Usage

Type FleckTest.exe %PORT_NUMBER

  • The program has two behaviours on the start process:
    • First tries to connect as client to server address (in fact, for testing pourposes, currently the address always is localhost) and a port passed as argument.
    • If the connection failed, assumed to the server is not running. Then starts the creation server proccess.

Overview and feature list

  • The client currently only implements a basic command to terminate chat session and close the program, exit.
  • The server supports, in theory (not tested it), an unlimited user sessions in the unique chat room.
  • Each user has able to register an unique username, any value and length except empty string or spaces.
  • The server assign an one color scheme to each user (12 variations).
  • User messages can be any string value and length except empty string or spaces.
  • The server can detect any client lost connection (the client crash or exit using the close window command instead of exit command) to avoid active ghost/abandoned sessions. The clients, at now, only catch the error when trying to send a message to a server that was crashed o not closed properly.

FYI: The Visual Studio project has defined a port number in debug profile (Project Properties -> Debug tab). You can run multiple instances of the program to run server and multiple clients (using Debug->Start New Instance command from context menu on project item in Solution Explorer window).

Issues/bugs

  • Sometimes, the prompt/input line is not deleted by the last user message printed in console.
  • Sometimes, the messages not uses the right color assigned.
  • Multiline messages not delete properly the last prompt/input printed line.
  • The above issues seems to be because a bad tasks synchronization when changed the console settings and cursor position corrections (necessary to the right prompt behaviour, for example).

TODO list

  • Implementing ping-pong task or similar in client to check state of the server (to end session in client when the server connection is lost).
  • Basic encryption on socket messages (this would be easy to implement in the ServerMessage model implementation).
  • Additional commands like "ping", to send beep sound to all users or an especific user maybe, for example (this might need to extend the IUserInputCommandProcessor service interface).

Disclaimer

This is a side project developed as result of a technical test for a job interview and a way to learn new technologies and common practices. Not intended to be a serious project or final product in the future.

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.