Skip to content

Commit 1664db2

Browse files
author
Ari Parkkila
committed
Cellular: Change CellularNonIPSocket to poll before timeout
1 parent 45aacf0 commit 1664db2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

features/netsocket/cellular/CellularNonIPSocket.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,12 @@ nsapi_size_or_error_t CellularNonIPSocket::send(const void *data, nsapi_size_t s
145145
nsapi_size_or_error_t CellularNonIPSocket::recv(void *buffer, nsapi_size_t size)
146146
{
147147
_lock.lock();
148-
nsapi_size_or_error_t ret;
148+
nsapi_size_or_error_t ret = NSAPI_ERROR_NO_SOCKET;
149149

150150
_readers++;
151151

152152
while (true) {
153153
if (!_opened) {
154-
ret = NSAPI_ERROR_NO_SOCKET;
155154
break;
156155
}
157156

@@ -173,6 +172,8 @@ nsapi_size_or_error_t CellularNonIPSocket::recv(void *buffer, nsapi_size_t size)
173172

174173
if (flag & osFlagsError) {
175174
// Timeout break
175+
// Poll once more for a possibly missed data received indication
176+
ret = _cp_netif->recv(buffer, size);
176177
break;
177178
}
178179
}

0 commit comments

Comments
 (0)