Retrieves one of the times associated with a socket.
sock_get_opt_time() function retrieves the value of a specific socket option that represents a time-related setting for the given socket descriptor.
;;; Retrieve one of the times on the socket (@interface func (export "sock_get_opt_time") ;;; Socket descriptor (param $fd $fd) ;;; Socket option to be retrieved (param $sockopt $sock_option) (result $error (expected $option_timestamp (error $errno))) )
ctx: A mutable reference to the function environment.
sock: The socket descriptor.
opt: The socket option to be retrieved.
ret_time: A WebAssembly pointer to the location where the retrieved time value should be stored.
The function returns an
Errno value indicating the outcome of the operation. If the operation is successful,
Errno::Success is returned. If an error occurs, an appropriate
Errno value is returned.
sock_get_opt_time()function retrieves the value of a specific socket option that represents a time-related setting for the specified socket descriptor.
- The specific socket option to retrieve is determined by the
- The retrieved value is stored in the memory location pointed to by the
ret_timeparameter, which should be a valid WebAssembly pointer to an
OptionTimestampvalue represents a time duration. It has a
tagfield that specifies whether the time is present (
OptionTag::Some) or not (
OptionTag::None), and a
ufield that holds the duration value in nanoseconds.
- If the socket option is not set or the requested time value is not applicable, the
tagfield of the returned
ufield will be zero.
- The behavior and limitations of the
sock_get_opt_time()function may vary depending on the specific runtime environment and underlying networking implementation. It is important to consult the documentation or specifications of the specific environment to understand its behavior in that context.