コード例 #1
0
 private void DisConnectButton_Click(object sender, EventArgs e)
 {
     GetData_From_Client.Abort();
     SendImage_To_Server_Thread.Abort();
     Client.Disconnect(false);
     Client.Shutdown(SocketShutdown.Both);
     Client.Close();
     ImageClient.Disconnect(false);
     ImageClient.Shutdown(SocketShutdown.Both);
     ImageClient.Close();
     SendButton.Enabled       = false;
     DisConnectButton.Enabled = false;
     ConnectButton.Enabled    = true;
     SendImageButton.Enabled  = false;
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: SNTDev/NetworkStudy
 private void CloseAll(object sender, FormClosingEventArgs e)
 {
     try
     {
         if (Client[0].Connected)
         {
             Client[0].Close();
         }
         if (InputClient.Connected)
         {
             InputClient.Close();
         }
         if (ImageClient.Connected)
         {
             ImageClient.Close();
         }
         ServerOpenThread.Abort();
         ReceiveImageThread.Abort();
     }
     catch (Exception E)
     {
     }
 }
コード例 #3
0
 private void CloseAll(object sender, FormClosingEventArgs e)
 {
     try
     {
         if (Client.Connected)
         {
             Client.Close();
         }
         if (ImageClient.Connected)
         {
             ImageClient.Close();
         }
         if (InputClient.Connected)
         {
             InputClient.Close();
         }
         GetData_From_Client.Abort();
         SendImage_To_Server_Thread.Abort();
         GetInput_Thread.Abort();
     }
     catch (Exception E)
     {
     }
 }