Socket Configuration#
The SiWN917 supports two modes of socket configurations:
BSD Socket Configuration
Asynchronous Socket Configuration
BSD Socket#
The BSD sockets application programming interface (API) is a set of standard function calls that can be used in an application. They allow programmers to add Internet Protocol communication to their products.
BSD Socket configuration is synchronized (the data is sent synchronously). Synchronous is a blocking architecture and is best for programming reactive systems. As a single-thread model, it follows a strict set of sequences, which means that operations are performed one at a time, in perfect order. While one operation is being performed, other operations instructions are blocked. The completion of the first task triggers the next, and so on.
The BSD socket implementation in SiWN917 tries to emulate the standards library to the extent possible for embedded offerings from Silicon Labs. There are substantial limitation/exceptions however, and those are mentioned in the API Reference Guide documentation.
Asynchronous Socket#
The asynchronous socket is a non-blocking architecture, which means it doesn’t block further execution while one or more operations are in progress. With async programming, multiple related operations can run concurrently without waiting for other tasks to complete.
Any scenario where you need to handle any significant number of concurrent connections, the asynchronous APIs are the only ones that provide adequate performance. In any interactive scenario (i.e., where you must deal with user input and output), the asynchronous approach is more easily integrated with the user interface. Async programming translates to a faster, more seamless flow in the real world.
In the SiWN917 asynchronous socket configuration, the data is sent or received asynchronously with a callback registered.