GithubHelp home page GithubHelp logo

sockettestchat's Introduction

SockChat

About

SockChat was an experiment to learn about how to write with .net Core, sockets, LiteNetLib and Avalonia. It is a very basic chat client and server that may be useful to other people to help learn from. It is licensed under the MIT license. See LICENSE for details.

At the time of writing, there's a binary of the Windows version of the client available on https://www.dropbox.com/s/76ghrf9u8vb0m2t/SockChatWindows.zip?dl=0 if you want to try it out which is connected to a server I'm running. As it runs off .net core, a build should work on any OS that .net core supports.

Building

This was an experiment (not a production ready tool), so you'll need to set the SERVER and PORT constants in Client.cs to where you want your server to connect.

You need to install the .net Core SDK which you can do on Windows from https://dotnet.microsoft.com/download, or on Linux from running https://dot.net/v1/dotnet-install.sh.

Once installed:

  • Run the server for debugging with dotnet run --project server
  • Run the client for debugging with dotnet run --project client
  • Run the unit tests with dotnet test
  • Publish the client for Windows with dotnet publish client -c Release -r win10-x64 -o Client-Win64
  • Publish the server for Linux with dotnet publish server -c Release -r linux-x64 -o Server-Linux

Running

Client

With the publish folder, run client.exe

Server

It's recommended to run the server as a service. With a systemd distro such as Debian 10, assuming that you've copied the publish folder to /root/Server-Linux

  • Create a Service file in /root/Server-Linux/SockChat.Service with the following contents:
[Unit]
Description="SockChat"
After=network.target

[Service]
User=root
Group=root
WorkingDirectory=/root/Server-Linux
ExecStart=/root/Server-Linux/server

[Install]
WantedBy=multi-user.target
  • Add the service to systemd
ln /root/Server-Linux/SockChat.service /etc/systemd/system/SockChat.service
  • Start the service

service SockChat start

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.