xp-framework/xp-framework — pull request #86 by ohinckel (2011-11-30 11:10:54+00:00)
Title: Fix timeout handling in BSDSocket::connect()

While releasing a new XP RC version I noticed that the tests hang at some point for a while. The reason is a test which tests the `peer.BSDSocket` functionality by starting a server locally and connecting to them. There are also tests which test `connec()`ting to wrong port using a short timeout (0.1 sec). But the connection timeout is not used and the tests stuck at this point.

There are two problems which are the cause of the problem:

* the timeout is set at the end of the function `peer.BSDSocket::connect()`
* the timeout is set to a wrong value since it uses `$this->_timeout` instead of the argument passed to `peer.BSDSocket::connect()` which is `$timeout`

It seems the problem exists since ~2009 where the timeout handling was refactored a little bit.