private void connectionRequestTimer_Tick(object sender, EventArgs e) { connectionRequestTimer.Stop(); int connID = screenShareManager.ControlConnectionForCreation(currentUserID, lessonID /*, Dns.GetHostEntry(Dns.GetHostName()).AddressList[0].ToString(),categoryID*/); //kontrol et varsa katıl yoksa create et if (connID != -1) { DesktopApplicationForm daf = new DesktopApplicationForm(currentUserID, connectionNameTextBox.Text, connID, lessonID); daf.Show(); } else { if (screenShareManager.HasConnection(currentUserID)) { btnSubmitConnectionName.Enabled = true; connectionNameTextBox.Enabled = true; connectionRequestTimer.Start(); } else { connectionRequestTimer.Start(); } } }
private void connectionCheckerTimer_Tick(object sender, EventArgs e) { connectionCheckerTimer.Stop(); connectionID = connectionID != 0 ? connectionID : screenShareManager.ControlConnectionForCreation(currentUserID, lessonID); //var olan bir connection varsa ona katlılmaya çalış //string myIP = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0].ToString(); if (connectionID != -1) { openForm(); } else { connectionID = screenShareManager.CreateConnection(currentUserID, connectionName, lessonID);//yeni connection oluştur ve başka bir kullanıcı bekle secondConnectionCheckerTimer.Start(); } }
public int ControlConnectionForCreation(int userID, int lessonID) //random bir connection bul ve kullanıcıyı ona ekle { return(screenShareComplexManager.ControlConnectionForCreation(userID, lessonID)); }