I relate to that, it's a vicious circle I'm trapped in where part of me desperately craves company and the other part wants to shut myself off from the world. I have lost all my friends because of this and have only myself to blame.
But I have also noticed that people tend to distance themselves as soon as they realise I have issues. This in my experience makes keeping a relationship going virtually impossible, though I suspect not meeting the right person doesn't help.