Transport, Socket and Channel correlation

I’m trying to wrap my head around the flow of messages from the client to a channel, standing in my way is the correlation between the socket, transport and channel pieces.
Please correct me on the below if I’m wrong.

Initial connection setup

  1. Request from client via communication library is handled by the Transport process on server.
  2. Transport process delegates/forward socket and other data to the Socket module
  3. Socket module invokes connect/id function to authenticate and do assignment where applicable
  4. Socket module communicates back to the Transport process

Incoming message (phx_join or a diff msg)

  1. Can I assume this will be routed directly from the Transport process to the Channel module, will the Transport process introspect the Socket module, use the channel macro to forward the request to the appropriate Channel or it’s has this information already via socket struct returned by Socket module in the initial connection setup phase?
  2. If the above is wrong; will the Transport process delegate to the Socket module which will then call then call the Channel module

Thank you.