How can I set a socket timeout for connecting. I want it so that if it doesn't connect within 1 second then it will timeout. I'm not using fsockopen(like it owuld matter, the timeout is messed on that). I've tried using various ways of implementing a timeout but none have worked :\. Any ideas?