Struct server::login_server::LoginServer
source · [−]pub struct LoginServer {
peer_id_receiver: Receiver<(PeerIdentifier, [u8; 32])>,
}Expand description
Wrapper for a TcpListener that accepts new clients and gives them the needed bits of information to talk to GameplaySocket.
Fields
peer_id_receiver: Receiver<(PeerIdentifier, [u8; 32])>Implementations
sourceimpl LoginServer
impl LoginServer
sourcepub fn new() -> Result<LoginServer>
pub fn new() -> Result<LoginServer>
Creates the TCP listener, and spawns a thread that will spawn another new thread for each incoming connection, one for each client.
Each client that succesfully finishes the TLS handshake gets a PeerIdentifier and an encryption key to pass to MessageOrderer::new.
sourcepub fn try_recv_new_peers(&mut self) -> Option<(PeerIdentifier, [u8; 32])>
pub fn try_recv_new_peers(&mut self) -> Option<(PeerIdentifier, [u8; 32])>
Returns any new peer-identifier-and-encryption-key-pairs that have been generated for new clients. Should be called until None is returned, like an iterator.
Auto Trait Implementations
impl !RefUnwindSafe for LoginServer
impl Send for LoginServer
impl !Sync for LoginServer
impl Unpin for LoginServer
impl !UnwindSafe for LoginServer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more