MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / TCPServerConnecter

Method TCPServerConnecter

src/network/core/tcp_connect.cpp:41–57  ·  view source on GitHub ↗

* Create a new connecter for the server. * @param connection_string The address to connect to. * @param default_port If not indicated in connection_string, what port to use. */

Source from the content-addressed store, hash-verified

39 * @param default_port If not indicated in connection_string, what port to use.
40 */
41TCPServerConnecter::TCPServerConnecter(std::string_view connection_string, uint16_t default_port) :
42 server_address(ServerAddress::Parse(connection_string, default_port))
43{
44 switch (this->server_address.type) {
45 case SERVER_ADDRESS_DIRECT:
46 this->connection_string = this->server_address.connection_string;
47 break;
48
49 case SERVER_ADDRESS_INVITE_CODE:
50 this->status = Status::Connecting;
51 _network_coordinator_client.ConnectToServer(this->server_address.connection_string, this);
52 break;
53
54 default:
55 NOT_REACHED();
56 }
57}
58
59TCPConnecter::~TCPConnecter()
60{

Callers

nothing calls this directly

Calls 2

NOT_REACHEDFunction · 0.85
ConnectToServerMethod · 0.80

Tested by

no test coverage detected