Merge branch 'master' into develop
This commit is contained in:
commit
b78569a77d
|
|
@ -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
|
||||
|
||||
33
README.md
33
README.md
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue