Wrote basic connection timeout code.