MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / WriteValidation

Method WriteValidation

extensions/olcPGEX_Network.h:586–603  ·  view source on GitHub ↗

ASYNC - Used by both client and server to write validation packet

Source from the content-addressed store, hash-verified

584
585 // ASYNC - Used by both client and server to write validation packet
586 void WriteValidation()
587 {
588 asio::async_write(m_socket, asio::buffer(&m_nHandshakeOut, sizeof(uint64_t)),
589 [this](std::error_code ec, std::size_t length)
590 {
591 if (!ec)
592 {
593 // Validation data sent, clients should sit and wait
594 // for a response (or a closure)
595 if (m_nOwnerType == owner::client)
596 ReadHeader();
597 }
598 else
599 {
600 m_socket.close();
601 }
602 });
603 }
604
605 void ReadValidation(olc::net::server_interface<T>* server = nullptr)
606 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected