Index: Source/HilTransport.c =================================================================== --- Source/HilTransport.c (revision 5590) +++ Source/HilTransport.c (working copy) @@ -227,8 +227,7 @@ } ptTransport->ptDefaultTranslationLayer = NULL; - /* 0xFFFF marks end of array */ - for(ulIdx = 0; ulIdx < ulTLCount; ulIdx++) + for(ulIdx = ulTLCount - 1; ulIdx > 0; ulIdx--) { PNETX_TL_INTERFACE_T ptTLInterface = netXTransportGetTranslationLayer(ausTL[ulIdx]); NXTHANDLE hTLHandle; @@ -274,20 +273,12 @@ ulDevice++; pvDeviceData = NULL; } + break; } - } else - { - if (ptTransport->ptDefaultTranslationLayer != NULL) - { - /* do not return an error because we have already found a supported layer */ - lRet = NXT_NO_ERROR; - } } - } else - { - /* translation layer is not supported, so try next one */ } } + if(NULL == ptTransport->ptDefaultTranslationLayer) { /* we failed to establish a connection to a server */