How does Trinity notifies connected clients?

Hello dear community.

I have been using Trinity for many years. For a recent stop I've managed to gather some programming skills over C# and recently I am digging deeper into C++.
As TrinityCore is most of all educational project I would like to ask probably a stupid question.

How does TrinityCore notifies clients about specific event?
I know it uses TCP as communication protocol, however I can't find anywhere in the source how actually TrinityCore notifies the client?

I've been looking around this function for example:

SpellCastResult WorldObject::CastSpell(WorldObject* target, uint32 spellId, CastSpellExtraArgs const& args /= { }/)
{
SpellCastTargets targets;
if (target)
{
if (Unit* unitTarget = target->ToUnit())
targets.SetUnitTarget(unitTarget);
else if (GameObject* goTarget = target->ToGameObject())
targets.SetGOTarget(goTarget);
else
{
TC_LOG_ERROR(“entities.unit”, “CastSpell: Invalid target %s passed to spell cast by %s”, target->GetGUID().ToString().c_str(), GetGUID().ToString().c_str());
return SPELL_FAILED_BAD_TARGETS;
}
}
return CastSpell(targets, spellId, args);
}

This is a function which for sure should notify clients about the occurred event of casted spell, right?

I saw that Trinity puts every connected client into separate thread and that's good. 

1. Can someone shed a bit more light on the basic overview not in details about the networking logic placed inside Trinity?
2. Is there any actual `send` function or something ?
3. How does Trinity recognizes that the client is sending information about specific event? I mean is there any code or number set as an indetifier about an event so when received Trinity says: " Oh.. yea I know this Number/Code/Identifier... John doe is informing that he is casting a spell"?

I know those are very general questions, but still i'll be very happy if you can answer in general. More of the logic/architecture and some code examples.

Kind regards,