https://developer.mbed.org/users/ohneta/code/NetworkSocketAPI/#efe7e291422b