Skip to content

Commit e4f91cd

Browse files
author
Hasnain Virk
committed
[ONME-2927] Socket adaptation layer for nanostack
As a result of major overhaul in Nanostack generally for socket API and especially for TCP, the adaptation layer for mbed-OS is being upgraded. Previously, as nanostack was not able to provide receive queue, adaptation layer had been faking it. Now with Stream Socket by default Nanostack provides 2K receive queue and 2K send queue. Receive queue size can be changed using setsockopt(). Batre metal nanostack would not provide with any receive queues with Datagram Socket, however in this adaptation layer we introduce a 2K receive queue size for the Datagram Socket as well. Layer state machine handling is polished to ensure robustness. ::socket_connect() will can return 2 new error codes now. NSAPI_ERROR_ALREADY (like posix EALREADY) in case if the connection is in progress or NSAPI_ERROR_IS_CONNECTED (like posix EISCONN) if already connected. NSAPI_ERROR_WOULDBLOCK is now mapped directly to nanostack NS_WOULDBLOCK. NanostackLockGaurd class is introduced which enables us to claim and release mutex using RAII style.
1 parent aa6d673 commit e4f91cd

File tree

3 files changed

+423
-295
lines changed

3 files changed

+423
-295
lines changed

0 commit comments

Comments
 (0)