示例#1
0
 private void FrmStartClient_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (socketClient != null)
     {
         socketClient.TokenSourceCheckingParcels.Cancel();
         socketClient.Dispose();
     }
 }
示例#2
0
文件: Chat.cs 项目: jackizhang/Chat
 private void Chat_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (_client == null || !_client.SocketConnected)
     {
         return;
     }
     _client.SendParcel("***HAS LEFT THE CHAT***");
     _client.TokenSourceCheckingParcels.Cancel();
     _client.Dispose();
 }