500ms might be a bit low for a tcp connection timeout, setting 5 seconds instead