My guess it may have smth to do with UpdateGoodsReceiptsAvailQty(). (I am not sure why is the purpose of this)
You can probably comment out it and see what happens.
I meant that file you were looking it, forgot the actual name sorry about that.
But that file, if you change the IP to the correct one, does it then connect?...