using shared lib for shared structs
This commit is contained in:
+1
-14
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user