The endpoint index is now part of the config structure.
Refactored the send/receive code.