reorganized folders to align with pub standards
Make sure that socket is flushed before adding new data