using shared lib for shared structs

This commit is contained in:
2026-08-15 18:27:37 +02:00
parent 2e4e6ebdb0
commit f6f1b764a4
5 changed files with 17 additions and 41 deletions
+1 -14
View File
@@ -1,7 +1,6 @@
use serde::{Deserialize, Serialize};
use shared::{ConectionResponse, ResponseStatus};
use std::sync::Arc;
use std::{collections::HashMap, net::SocketAddr};
use tokio::io::AsyncWriteExt;
use tokio::{
net::{TcpListener, UdpSocket},
@@ -15,18 +14,6 @@ struct Client {
type State = Arc<RwLock<HashMap<u32, Client>>>;
#[derive(Serialize, Deserialize)]
enum ResponseStatus {
Ok,
Err,
}
#[derive(Serialize, Deserialize)]
struct ConectionResponse {
status: ResponseStatus,
client_id: u32,
}
#[tokio::main]
async fn main() {
let listen_address = "0.0.0.0:8080";