lwip - Fixed error codes for failed TCP connect

condition               posix error     mbed error
good host, closed port  ECONNREFUSED    NSAPI_ERROR_NO_CONNECTION
bad host                EHOSTUNREACH    NSAPI_ERROR_NO_CONNECTION
bad network             ENETUNREACH     NSAPI_ERROR_NO_CONNECTION
pull/3403/head
Christopher Haster 2016-11-28 10:14:25 -06:00
parent 1b019c398b
commit 9b2a02f9ec
1 changed files with 2 additions and 1 deletions

View File

@ -555,11 +555,12 @@ static nsapi_error_t mbed_lwip_err_remap(err_t err) {
switch (err) {
case ERR_OK:
case ERR_CLSD:
case ERR_RST:
return 0;
case ERR_MEM:
return NSAPI_ERROR_NO_MEMORY;
case ERR_CONN:
case ERR_RST:
case ERR_ABRT:
return NSAPI_ERROR_NO_CONNECTION;
case ERR_TIMEOUT:
case ERR_RTE: