Yes, I've been there, exactly where you are - feeling lonely, isolated, like I was the only one and no one would understand.
When I "came out" it was more difficult to meet other gay men, to talk about it and to get any information on being gay and coming out.
I got to the point where I was so miserable that it was effecting all aspects of my life. I wasn't miserable because I was gay, I'd accepted that fact, I was miserable because I was holding it all inside.
I finally talked with a counselor at college, and she told me that while I felt like I was the only one feeling the way I did, I was NOT unique. Other people had, and will be, in the exact same situation I was in.
First of all, come out to yourself, if you haven't done that already - you have to acknowledge that you are a gay man, and accept that - don't pretend that you're confused, or it's a phase, or you'll change. Pretty damned likely that's not going to happen.
And, stop thinking that everyone is going to reject you or shut you out - that may happen with some, and with some very important people in your life. But, there are understanding people, and honestly, some of them probably already know you're gay - they are just waiting for you to tell them.
If you're not ready to come out to family or friends, then don't - do it when you're ready - but you'll feel so much better once you do. Even if their reaction is not positive, you'll at least be living an honest life. You'll feel like a huge weight has been removed. And, no, it's not the answer to all your problems, it might even create some - but living open and honest is much better than hiding and not being true to yourself.
Good luck - and stay strong. We've all been there.