fixed buf stackoverflow + removed scopeSocket comments
fixed receive condition + added comments / log