I’m trying to modify this example to my needs, but one line in particular has me stumped. The line ((Action<List<MessageInfo>>)parm)(msgs); in the chatserver makes absolutely no sense to me. I can see that it typecasts (msgs) to the type ((Action<List<MessageInfo>>)parm);, but it doesn’t seem to do anything at all.
I hope that someone can help me understand this, as I have a feeling it one of the last pieces I’m missing of this puzzle…
Kind regards.
They are casting a delegate, then invoking it with
msgs.This bit:
Casts the delegate. Then it invokes the delegate with
msgs.Breaking it down a bit:
The author just chose to collapse all of that into one line.