maybe "row" can be behavior like a shared variable rather than
Yes, the row
variable is captured - so whenever it's read, it's the latest value that's read. You should put the variable declaration inside the loop:
while (socket.Connected) {
string row = socket.readLine();
if (IsControlValid(this)) {
// Removed String.Copy call, as it was pointless
BeginInvoke((MethodInvoker)delegate { UpdateForm(row); });
}
}
Now you'll have a different variable for each iteration of the loop, so you won't be overwriting the previous value in one thread while you're reading it in the delegate.