I think something might be off with UnityEngine.Networking.ConnectionConfig.ConnectTimeout. Considering what is in the docs I would expect the total timeout of a connection process to 127.0.0.1 on a closed port to be
var expected = config.ConnectTimeout * config.MaxConnectionAttempt;
So having ConnectTimeout = 10000 and MaxConnectionAttempt = 2 MaxConnectionAttempt = 1 should result in a Disconnect/Timeout after at least 20s 10s. Could be a bit more depending of the game update rate but certainly not less. However I’m getting a timeout in less than a second… Did I miss anything here !?
Edit: Just for the record if anyone else come accross the same issue. After watching the problem closer I realized that as of vesion 5.3 the NetworkTransport is trying to connect up to (MaxConnectionAttempt-1) times, so the total timeout is actually ConnectTimeout *(MaxConnectionAttempt-1) and if you pass MaxConnectionAttempt = 1 you receive a Disconnect/Timeout in the next frame without any real connection attempt taking place.