IOS socket errors

This was one of my solution approaches to solve my original problem, which I posted here Problems device ownership doing Simple Authentication in my iOS app

There I tried to implement simple Authentication but unfortunately, I always got several socket errors.