Implemented socket timeout and connection confirmation feature. They are completely untested currently.