Skip to content

Commit

Permalink
[ONME-2927] Socket adaptation layer for nanostack
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Hasnain Virk committed Feb 12, 2017
1 parent aa6d673 commit e4f91cd
Show file tree
Hide file tree
Showing 3 changed files with 423 additions and 295 deletions.
Loading

0 comments on commit e4f91cd

Please sign in to comment.