diff --git a/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Sockets_NativeSocket.cpp b/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Sockets_NativeSocket.cpp index 08dab47c20..c800eb919c 100644 --- a/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Sockets_NativeSocket.cpp +++ b/src/DeviceInterfaces/System.Net/sys_net_native_System_Net_Sockets_NativeSocket.cpp @@ -739,7 +739,7 @@ HRESULT Library_sys_net_native_System_Net_Sockets_NativeSocket::SendRecvHelper( // send/recv/sendto/recvfrom failed if(bytes == SOCK_SOCKET_ERROR) { - CLR_INT32 err = SOCK_getlasterror(); + CLR_INT32 err = SOCK_getsocklasterror(handle); if(err != SOCK_EWOULDBLOCK) {