No sleep should be necessary. Are you using the same socket with other threads or processes? One socket per thread/process is the golden rule.
Example issue as a reference: