Пример #1
0
 private void ExceptionHandle(string message, Socket socket)
 {
     if (Receive_RichTextBox.InvokeRequired)
     {
         var d = new ShowDelegate(ExceptionShow);
         Receive_RichTextBox.Invoke(d, new object[] { message, socket });
     }
     else
     {
         ExceptionShow(message, socket);
     }
 }
Пример #2
0
 private async Task Receive()
 {
     if (Receive_RichTextBox.InvokeRequired)
     {
         var d = new ReceiveDelegate(ReceiveMessage);
         Receive_RichTextBox.BeginInvoke(d);
     }
     else
     {
         await ReceiveMessage();
     }
 }
Пример #3
0
 private async Task Receive(Socket connection)
 {
     if (Receive_RichTextBox.InvokeRequired)
     {
         var d = new listenDelegate(ReceiveMessage);
         Receive_RichTextBox.Invoke(d, connection);
         return;
     }
     else
     {
         await ReceiveMessage(connection);
     }
 }