Removed duplicate socket initialization and corrected timeout values.

I don't have any significant experience with sockets on Linux/Mac, so it's entirely possible that I'm overlooking a valid reason why the code is correct as is. If that's the case, I think a couple comments explaining why would be warranted.