private void btnConnect_Click(object sender, EventArgs e) { _serverConnection = new ServerConnection(); _serverConnection.Connect(txtServerIP.Text, Convert.ToInt32(txtServerPort.Text), txtNickname.Text); //TODO: Connect to server this.Close(); }
async void ConnectAsync(object sender, EventArgs e) { await _serverConnection.Connect(txtServerIP.Text, Convert.ToInt32(txtServerPort.Text), txtNickname.Text); }