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

Method ConnectToServer

extensions/olcPGEX_Network.h:373–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371 }
372
373 void ConnectToServer(const asio::ip::tcp::resolver::results_type& endpoints)
374 {
375 // Only clients can connect to servers
376 if (m_nOwnerType == owner::client)
377 {
378 // Request asio attempts to connect to an endpoint
379 asio::async_connect(m_socket, endpoints,
380 [this](std::error_code ec, asio::ip::tcp::endpoint endpoint)
381 {
382 if (!ec)
383 {
384 // Was: ReadHeader();
385
386 // First thing server will do is send packet to be validated
387 // so wait for that and respond
388 ReadValidation();
389 }
390 });
391 }
392 }
393
394
395 void Disconnect()

Callers 1

ConnectMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected