Merge branch 'master' into develop

This commit is contained in:
michael bailey 2024-01-03 23:35:08 +00:00 committed by GitHub
commit b78569a77d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 59 additions and 2 deletions

25
.github/workflows/rust.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: Rust
on:
push:
branches: [ ref-method ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: check
run: cargo check --verbose
- name: Build
run: cargo build --verbose

View File

@ -1 +1,32 @@
# rust-chat-server
# Rust-chat-server
A Chat server writen in rust to allow communication between peers.
---
## Features:
- implemented:
- json based API.
- Server introspection.
- Peer discovery.
- sending messages to connected clients.
-
- todo:
- Encryption to server.
- server to server meshing.
- asynchronous client managment instead of threaded approach.
## Goals:
- Learn the rust programming lanaguage.
- Ownership: how that affects normal programming styles.
- Borrowing and references: how this affects shared state.
- Lifetimes: how this affects data retention and sharing.
- Learn how to create networked programs.
- Application level protocol: how to get two programs to communicate via TCP sockets.
- Socket handling: Discovering ways to handle multiple socket connections without affecting performance.
- Learn common encryption protocols.
- Adding support for encrypted sockets.
- Pros and cons of symetric and asymetric encryption.
- resolving common encryption flaws
> Questions: For questions please add a issue with the question label. It will eventually be responded to

View File

@ -83,6 +83,7 @@ impl Client {
}
}
pub(crate) fn _error(&self, msg: String) {
println!("[Client] sending error: {}", msg);
use serde_json::to_string;
@ -246,6 +247,7 @@ impl Handler<ConnectionObservableOutput> for Client {
}
ConnectionObservableOutput::ConnectionClosed(_) => self
.broadcast(ClientObservableMessage::Disconnecting(self.details.uuid)),
}
}
}

View File

@ -59,7 +59,6 @@ impl NetworkListener {
use ListenerOutput::NewConnection;
let listener = TcpListener::bind(addr).await.unwrap();
while let Ok((stream, addr)) = listener.accept().await {
println!("[NetworkListener] accepted socket");
let conn = Connection::new(stream, addr);