server handshake gui

This commit is contained in:
2026-01-02 23:21:50 +01:00
parent 1914c68c9f
commit 74f30f2c7f
5 changed files with 91 additions and 55 deletions

View File

@@ -1,3 +1,4 @@
use crate::P2PSharedData;
use crate::cryptographic_signature::CryptographicSignature;
use crate::message_handling::EventType;
use crate::message_handling::handle_recevied_message;
@@ -111,17 +112,11 @@ impl MultipleSenders {
});
}*/
pub fn start_receving_thread(
socket: &Arc<UdpSocket>,
messages_list: &Arc<Mutex<HashMap<i32, EventType>>>,
crypto_pair: &Arc<CryptographicSignature>,
socket_addr: SocketAddr,
senders: &Arc<MultipleSenders>,
) {
let sock_clone = Arc::clone(socket);
let cryptopair_clone = Arc::clone(crypto_pair);
let senders_clone = Arc::clone(senders);
let messages_clone = Arc::clone(messages_list);
pub fn start_receving_thread(shared_data: &P2PSharedData, socket_addr: SocketAddr) {
let sock_clone = shared_data.socket();
let cryptopair_clone = shared_data.cryptopair();
let senders_clone = shared_data.senders();
let messages_clone = shared_data.messages_list();
thread::spawn(move || {
let mut buf = [0u8; 1024];
loop {