veloren/network/protocol/src/udp.rs
Marcel Märtens 9884019963 COMPLETE REDESIGN of network crate
- Implementing a async non-io protocol crate
    a) no tokio / no channels
    b) I/O is based on abstraction Sink/Drain
    c) different Protocols can have a different Drain Type
       This allow MPSC to send its content without splitting up messages at all!
       It allows UDP to have internal extra frames to care for security
       It allows better abstraction for tests
       Allows benchmarks on the mpsc variant
       Custom Handshakes to allow sth like Quic protocol easily
 - reduce the participant managers to 4: channel creations, send, recv and shutdown.
   keeping the `mut data` in one manager removes the need for all RwLocks.
   reducing complexity and parallel access problems
 - more strategic participant shutdown. first send. then wait for remote side to notice recv stop, then remote side will stop send, then local side can stop recv.
 - metrics are internally abstracted to fit protocol and network layer
 - in this commit network/protocol tests work and network tests work someway, veloren compiles but does not work
 - handshake compatible to async_std
2021-02-17 12:39:47 +01:00

38 lines
589 B
XML

// TODO: quick and dirty which activly waits for an ack!
/*
UDP protocol
All Good Case:
S --HEADER--> R
S --DATA--> R
S --DATA--> R
S <--FINISHED-- R
Delayed HEADER:
S --HEADER-->
S --DATA--> R // STORE IT
--HEADER--> R // apply left data and continue
S --DATA--> R
S <--FINISHED-- R
NO HEADER:
S --HEADER--> !
S --DATA--> R // STORE IT
S --DATA--> R // STORE IT
S <--MISSING_HEADER-- R // SEND AFTER 10 ms after DATA1
S --HEADER--> R
S <--FINISHED-- R
NO DATA:
S --HEADER--> R
S --DATA--> R
S --DATA--> !
S --STATUS--> R
S <--MISSING_DATA -- R
S --DATA--> R
S <--FINISHED-- R
*/