Its probably firewall - but if turning them off / opening up ports doesn't help:
Are you running any P2P, File-Sharing, "distributed computing" (i.e. SETI@Home or similar), or other "background" type programs on your machine that might access the Internet while you're also playing SL?
I've noticed that some programs, or the ad-ware associated with them, can cause some problems similar to this. I have seen Kazaa, for example, cause this for certain - and its bloated with spyware /adware these days, too.
After getting this error, can you browse the web immediately and without problem?
If the web is accessible immediately after getting this error in SL, then I'd be really surprised if it isn't a problem with your SL installation, or Router/Firewall.
But, you should try to turn off/exit any extraneous programs that are running on your system other than SL - including anything running in your "System Tray", if you're using Windows (the System Tray is next to your clock).
If you suspect you might have ad-ware/spyware, there are some handy tools that you can download for free that will clean your system. There are a number to choose from - but for Windows, Microsoft just released a free one on their
www.microsoft.com website that I've actually been favorably impressed with so far.
Please feel free to post more details if you try the above steps and are still having problems.
Hope you're rockin' in SL soon!
Take care,
--Noel "HB" Wade
(Tread Whiplash)