Tizen Sockets Extension

This article lists functions provided by Tizen Sockets Extensions for WebAssembly

Supported socket related functions

When possible semantics of these functions conform to POSIX.1-2017.

Most notable differences are:

  • lack of signals support in Emscripten and in web environment.
  • Tizen Sockets Extensions APIs cannot be called from the main thread, which is usually the one running main function unless -s PROXY_TO_PTHREAD or --proxy-to-worker flags were provided to Emscripten during link time. See Additional flags chapter in Emscripten documentation.

Following extensions to sockets are provided:

accept() and accept4()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/accept.html
  • https://linux.die.net/man/2/accept4

Supported flags in accept4():

  • SOCK_NONBLOCK
  • SOCK_CLOEXEC

bind()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html

close()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html

connect()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html

freeaddrinfo()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/freeaddrinfo.html

getaddrinfo()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/freeaddrinfo.html

gethostbyaddr()

References:

  • https://linux.die.net/man/3/gethostbyaddr

gethostbyname()

References:

  • https://linux.die.net/man/3/gethostbyname

getpeername()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpeername.html

getsockname()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockname.html

getsockopt()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockopt.html
  • https://www.tldp.org/HOWTO/Multicast-HOWTO-6.html
  • http://man7.org/linux/man-pages/man7/ip.7.html

Supported level and optname combinations:

  • SOL_SOCKET, SO_DEBUG
  • SOL_SOCKET, SO_ERROR
  • SOL_SOCKET, SO_BROADCAST
  • SOL_SOCKET, SO_REUSEADDR
  • SOL_SOCKET, SO_KEEPALIVE
  • SOL_SOCKET, SO_OOBINLINE
  • SOL_SOCKET, SO_SNDBUF
  • SOL_SOCKET, SO_RCVBUF
  • SOL_SOCKET, SO_DONTROUTE
  • SOL_SOCKET, SO_RCVLOWAT
  • SOL_SOCKET, SO_SNDLOWAT
  • SOL_SOCKET, SO_RCVTIMEO
  • SOL_SOCKET, SO_SNDTIMEO
  • SOL_SOCKET, SO_LINGER
  • IPPROTO_TCP, TCP_NODELAY
  • IPPROTO_IP, IP_MULTICAST_LOOP
  • IPPROTO_IP, IP_MULTICAST_TTL
  • IPPROTO_IPV6, IPV6_MULTICAST_HOPS
  • IPPROTO_IPV6, IPV6_MULTICAST_LOOP

listen()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/listen.html

poll()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html

Supported event flags:

  • POLLIN
  • POLLRDNORM
  • POLLRDBAND
  • POLLPRI
  • POLLOUT
  • POLLWRNORM
  • POLLWRBAND
  • POLLERR
  • POLLHUP
  • POLLNVAL

select()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/pselect.html

send()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/send.html

Supported flags:

  • MSG_EOR
  • MSG_OOB
  • MSG_NOSIGNAL

sendmsg()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendmsg.html

Supported flags:

  • MSG_EOR
  • MSG_OOB
  • MSG_NOSIGNAL

sendto()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html

Supported flags:

  • MSG_EOR
  • MSG_OOB
  • MSG_NOSIGNAL

setsockopt()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/setsockopt.html
  • https://www.tldp.org/HOWTO/Multicast-HOWTO-6.html
  • http://man7.org/linux/man-pages/man7/ip.7.html

Supported level and optname combinations:

  • SOL_SOCKET, SO_DEBUG,
  • SOL_SOCKET, SO_BROADCAST
  • SOL_SOCKET, SO_REUSEADDR
  • SOL_SOCKET, SO_KEEPALIVE
  • SOL_SOCKET, SO_OOBINLINE
  • SOL_SOCKET, SO_SNDBUF
  • SOL_SOCKET, SO_RCVBUF
  • SOL_SOCKET, SO_DONTROUTE
  • SOL_SOCKET, SO_RCVLOWAT
  • SOL_SOCKET, SO_SNDLOWAT
  • SOL_SOCKET, SO_RCVTIMEO
  • SOL_SOCKET, SO_SNDTIMEO
  • SOL_SOCKET, SO_LINGER
  • IPPROTO_TCP, TCP_NODELAY
  • IPPROTO_IP, IP_MULTICAST_LOOP
  • IPPROTO_IP, IP_MULTICAST_TTL
  • IPPROTO_IP, IP_ADD_MEMBERSHIP
  • IPPROTO_IP, IP_ADD_SOURCE_MEMBERSHIP
  • IPPROTO_IP, IP_BLOCK_SOURCE
  • IPPROTO_IP, IP_DROP_MEMBERSHIP
  • IPPROTO_IP, IP_DROP_SOURCE_MEMBERSHIP
  • IPPROTO_IP, IP_UNBLOCK_SOURCE
  • IPPROTO_IPV6, IPV6_MULTICAST_HOPS
  • IPPROTO_IPV6, IPV6_MULTICAST_LOOP
  • IPPROTO_IPV6, IPV6_JOIN_GROUP
  • IPPROTO_IPV6, IPV6_LEAVE_GROUP

shutdown()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/shutdown.html

Supported how values:

  • SHUT_RD
  • SHUT_WR
  • SHUT_RDWR

socket()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/socket.html
  • http://man7.org/linux/man-pages/man2/socket.2.html

Supported domain values:

  • AF_INET
  • AF_INET6

Supported type:

  • SOCK_STREAM
  • SOCK_DGRAM

Flags bitwise ORed with type argument:

  • SOCK_CLOEXEC
  • SOCK_NONBLOCK

read()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html

recv()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/recv.html

Supported flags:

  • MSG_PEEK
  • MSG_OOB
  • MSG_WAITALL

recvfrom()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html

Supported flags:

  • MSG_PEEK
  • MSG_OOB
  • MSG_WAITALL

recvmsg()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvmsg.html

Supported flags:

  • MSG_PEEK
  • MSG_OOB
  • MSG_WAITALL

write()

References:

  • https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html