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); } }
private async Task Receive() { if (Receive_RichTextBox.InvokeRequired) { var d = new ReceiveDelegate(ReceiveMessage); Receive_RichTextBox.BeginInvoke(d); } else { await ReceiveMessage(); } }
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); } }