private void signing(object o, OnEventArgs oea) { int tnum = oea.tNum; int num = oea.Num; heavymethod(); CC_TCP.send(oea.SOC, $"test{num:00}->{tnum:00}"); textBox1.AppendText($"[Send{num:00}] test-{tnum:00}\r\n"); }
void WriteCallback(IAsyncResult ar) { Console.WriteLine("WriteCallback ThreadID:" + Thread.CurrentThread.ManagedThreadId); StateObject state = (StateObject)ar.AsyncState; OnEventArgs OEA = new OnEventArgs(state.workSocket); string msg = state.sb; Int32.TryParse(msg.Substring(11, 2), out int tnum); Int32.TryParse(msg.Substring(43, 1), out int num); OEA.tNum = tnum; OEA.Num = num; FM.Invoke(SD_Send, new object[] { this, OEA }); send(state.workSocket, msg); Console.WriteLine("送信完了"); OEA.SOC.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReadCallback), state); }