“What he wanted to do, however inappropriately, was to continue that relationship and have come company in his life,” Mr Killeen added.

He had been bailed to his mother’s address in Stockton but when that was no longer available to him he lived rough for two days.

When he explained the situation to his solicitors he was advised to hand himself in to police and he immediately did so, which was why he appeared for sentence in custody.

Eddy had pleaded guilty at the earliest opportunity to three breaches of the sex register requirements.

The judge, Mr Recorder Gregg Bull QC said: “I accept that your relationship was not in order to target any children in particular,” he said.

But it was the second breach of an order and the requirements were draconian and were meant to protect children and the public and enable the police to keep track of sexual offenders, the judge said.