Proper Locking in all socket writing, updated NuGet packages