Sets one of the times associated with a socket.
sock_set_opt_time() function sets the value of a specific socket option that represents a time-related setting for the given socket descriptor.
;;; Sets one of the times the socket (@interface func (export "sock_set_opt_time") ;;; Socket descriptor (param $fd $fd) ;;; Socket option to be set (param $sockopt $sock_option) ;;; Value to set the time to (param $timeout (@witx const_pointer $option_timestamp)) (result $error (expected (error $errno))) )
ctx: A mutable reference to the function environment.
sock: The socket descriptor.
opt: The socket option to be set.
time: A WebAssembly pointer to the value representing the time to set.
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_set_opt_time()function sets the value of a specific socket option that represents a time-related setting for the specified socket descriptor.
- The specific socket option to set is determined by the
- The value to set is read from the memory location pointed to by the
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.
- The behavior and limitations of the
sock_set_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.