* 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. */
| 39 | * @param default_port If not indicated in connection_string, what port to use. |
| 40 | */ |
| 41 | TCPServerConnecter::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 | |
| 59 | TCPConnecter::~TCPConnecter() |
| 60 | { |
nothing calls this directly
no test coverage detected