You know what, I had the same problem too. I did ask in lot of forums about this, and I came up with an amazing answer from a friend.
"The one good thing you can do when your lonely is spend time with the most beautiful and purest minds. Go spend time in some orphanage. Play and share your knowledge with the kids there. Or go spend some time in an old age home. See how even the old are finding new things to engage themselves. And if you don't find any of this, go play with a dog. You will never find yourself alone."
So true isn't it. Well I got a dog after that and yes I don't feel lonely anymore.