pub fn sock_open<M: MemorySize>(
ctx: FunctionEnvMut<'_, WasiEnv>,
af: Addressfamily,
ty: Socktype,
pt: SockProto,
ro_sock: WasmPtr<Fd, M>,
) -> Result<Errno, WasiError>
Expand description
§sock_open()
Create an endpoint for communication.
creates an endpoint for communication and returns a file descriptor tor that refers to that endpoint. The file descriptor returned by a successful call will be the lowest-numbered file descriptor not currently open for the process.
Note: This is similar to socket
in POSIX using PF_INET
§Parameters
af
- Address familysocktype
- Socket type, either datagram or streamsock_proto
- Socket protocol
§Return
The file descriptor of the socket that has been opened.