Base class for IP Based Networking Libraries

Dependencies:   DnsQuery

Dependents:   TempTower BSDInterfaceTests HelloBSDInterface ESP8266InterfaceTests ... more

For a complete getting started guide see the wiki...

Network Socket API

The Network Socket API provides a common interface for using sockets on network devices. The API provides a simple class-based interface that should be familiar to users experienced with other socket APIs. Additionally, the API provides a simple interface for implementing network devices, making it easy to connect hardware agnostic programs to new devices.

Network Interfaces

The NetworkInterface provides an abstract class for network devices that support sockets. Devices should provide a DeviceInterface class that inherits this interface and adds implementation specific methods for using the device. A NetworkInterface must be provided to a Socket constructor to open a socket on the interface. Currently two subclasses are defined for common devices, EthernetInterface and WiFiInterface.

Sockets

The Socket class is used for managing network sockets. Once opened, the socket provides a pipe through which data can sent and recieved to a specific endpoint. The socket class can be instantiated as either a TCPSocket or a UDPSocket which defines the protocol used for the connection.

Revisions of Socket.cpp

Revision Date Message Actions
118:96627c4b83d5 2016-04-20 Fix for timeout issue with WFI File  Diff  Annotate
115:950b19eb0f02 2016-04-20 Consolidate set_timeout/set_blocking behaviour to avoid ambiguity when both are used and match python behaviour File  Diff  Annotate
109:5d8bd5752386 2016-04-19 Merged changes to NSAPI File  Diff  Annotate
108:2e5eccf30a84 2016-04-20 Fixe race condition in socket close File  Diff  Annotate
105:2fd212f8da61 2016-04-19 Rename Interface -> Stack File  Diff  Annotate
99:f51358e506c1 2016-04-19 Revised stack specific configurations File  Diff  Annotate
98:0f614f1d0398 2016-04-19 Move bind to Socket File  Diff  Annotate
93:65a9f84862f0 2016-04-19 Renamed NetworkInterface create/destroy methods to match Socket methods File  Diff  Annotate
92:dd5f19874adf 2016-04-19 Move to single state-change interrupt File  Diff  Annotate
91:cad29ce6a01c 2016-04-19 Remove shutdown parameter from close call File  Diff  Annotate
90:0a988e4abb72 2016-04-19 Add open call as alternative to passing NetworkInterface at construction File  Diff  Annotate
89:b1d417383c0d 2016-04-19 Adopt mbed style doxygen comments File  Diff  Annotate
87:94e2cf3a06be 2016-04-05 Refactored enums File  Diff  Annotate
86:7ca9776b9cc0 2016-04-05 Updated dependencies File  Diff  Annotate
84:d317e056fd20 2016-04-05 Added thunk for Socket class File  Diff  Annotate
79:43a7e8c0d6cc 2016-04-05 Added rough implementation of the API shim File  Diff  Annotate
70:aa343098aa61 2016-04-01 Fixed merged api-changes File  Diff  Annotate
68:a52251517491 2016-04-01 Reverted api-changes File  Diff  Annotate
66:c84a4c76cb94 2016-04-01 Changed API to better match Posix sockets; ; - Send returns size on success; - Returns NS_ERROR_WOULD_BLOCK when recv would block File  Diff  Annotate
65:ca337f9ebdab 2016-04-01 Added support for closing sockets during blocking recvs File  Diff  Annotate
58:1caa187fa5af 2016-02-25 Removed setURL/IPAddress/Port set of functions from Socket and SocketInterface File  Diff  Annotate
57:3c873fab4207 2016-02-25 Standardized prefix to NS for enums and constants File  Diff  Annotate
54:0c764f654352 2016-02-25 Added correct handling of sockets when closed multiple times File  Diff  Annotate
49:85fe0b99948d 2016-02-25 Fixed naming collision File  Diff  Annotate
48:b3bbe28a7963 2016-02-25 Added non-blocking recv File  Diff  Annotate
45:c8aca7c1e93f 2016-02-24 Added inexaustive list of standardized error codes File  Diff  Annotate
43:09ea32f2eb54 2016-02-24 Responded to feedback in API decisions File  Diff  Annotate
42:49893d13c432 2016-02-23 Standardized some C++ style things File  Diff  Annotate
41:3ec1c97e9bbf 2016-02-23 Moved timeout handling to setTimeout/getTimeout functions File  Diff  Annotate
39:47138420ea42 2016-02-22 Added proper handling of missing ip/port File  Diff  Annotate
38:157fb2ab965f 2016-02-22 Added isConnected method to Socket/SocketInterface File  Diff  Annotate
36:eab792dfb0d8 2016-02-22 Added passing of ip/port into SocketInterface::open for implementation convenience File  Diff  Annotate
35:838393fbc2ca 2016-02-22 Added error on connect without ip/port File  Diff  Annotate
34:c17745683385 2016-02-22 Added url/ip/port as optional arguments to open File  Diff  Annotate
32:2c5fc105fc50 2016-02-22 Added open/close calls to all sockets File  Diff  Annotate
31:7f15b95f2a1d 2016-02-22 Added dependency on DnsQuery accessible through getHostByName File  Diff  Annotate
30:3cc78f5db99d 2016-02-22 Standardized formatting File  Diff  Annotate
29:7bcec3189a93 2016-02-22 Fixed include statements File  Diff  Annotate
28:163fbe3263f4 2016-02-18 Removed memory allocations for internal buffers File  Diff  Annotate
27:d7ed39727306 2016-02-18 Added better behaviour for urls in constructors File  Diff  Annotate
25:ed7b2a52e8ac 2016-02-18 Added abstract base case for Sockets File  Diff  Annotate