This section provides an overview of Tizen Sockets Extension, allowing low-level socket access. This feature allows building real time media streaming applications that can use protocols like RTP/RTSP.
Socket functions can be called from a JavaScript Worker thread.
The Tizen Sockets Extension is a Samsung extension API which grants a WebAssembly application low-level access to Tizen platform sockets. It offers high bandwidth and low latency for the TCP and UDP connection protocols.
An example use case is applications using real-time multimedia streaming (using the RTP/RTSP protocol). One such sample application is Moonlight GameStreaming (its source code can be found on github. Moonlight was presented at SDC2019.
For an example on using the Tizen Sockets Extension in practice, see Building cURL Applications Using CLI Tools and Building cURL Applications Using Tizen Studio.
Differences Between Tizen Sockets Extension and POSIX
Where possible, the semantics of the Tizen Sockets Extension methods conform to POSIX.1-2017. The most notable differences are:
Emscripten and the Web environment lack signal support.
Tizen Sockets Extension APIs cannot be called from the main thread, which is usually the one running the main function, unless the -s PROXY_TO_PTHREAD or --proxy-to-worker flags were provided to Emscripten during link time. See the Additional flags chapter in the Emscripten documentation.
Socket methods that accept multiple descriptors can accept only one descriptor type at a time. Descriptor types cannot be mixed (for example, a function can be called with either socket descriptors or file descriptors, but not both). In particular, this applies to poll() and select() methods.
The select() method can be slow due to its internal implementation in Emscripten. It is recommended to use poll() instead.
The following extensions to sockets are provided:
SOCK_NONBLOCK and SOCK_CLOEXEC flags when creating socket()
accept4() method
IPv4 multicast options in getsockopt() and setsockopt().
gethostbyaddr() method
gethostbyname() method
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
developer.samsung.com, .samsung.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
Samsung Electronics
.samsung.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
Samsung Electronics
developer.samsung.com, google.account.samsung.com
Preferences Submitted
You have successfully updated your cookie preferences.