Close when connection is broken.
Use sizeof(void*) and fix list remove.
Store item pointer before removal.
Remove duplicates.