Provides functions for the socket related operations.
This module provides the socket related functions, such as open a socket, close a socket, bind a socket to an internet address, connect to the peer node, send and receive data from a peer node, etc.
The functions in this module provide similar capabilities as provided by BSD or POSIX socket API.
Refer to the documentation of each function for details.
The parameter of flags in all the functions provided in this module is not used. The parameter of flags is a reserved parameter.
Function |
Description |
Accepts a connection on a socket. | |
Binds a local address with a socket. | |
Closes the socket and release the resource. | |
Connects a socket to a remote host. | |
Gets the local IP held by the socket as specified. | |
Retrieves the IP address and port number of the endpoint node. | |
Retrieves the local IP address and port number. | |
Gets the socket options. | |
Converts long integer (32 bits) from host byte order to network byte order. | |
Converts short integer (16 bits) from host byte order to network byte order | |
Converts the internet address in a dotted-decimal string notation into an internet network address in the IN_ADDR structure. | |
Converts an internet network address into a dotted-decimal string format. | |
Converts an IPv4 or IPv6 address in its numeric binary form in network byte order into its standard text representation form. The format of 'x:x:x:x:x:x:d.d.d.d' is not supported. | |
Converts an IPv4 or IPv6 address in its standard text presentation form into its numeric binary form in network byte order. The format of 'x:x:x:x:x:x:d.d.d.d' is not supported. | |
Receives data on a connected socket. | |
Receives data from the endpoint node. | |
Allows the application to query the status of multiple sockets. If timeout is null, vm_soc_select() will wait indefinitely until the first socket is ready. If both tv_sec and tv_msec are zero, vm_soc_select() will timeout immediately for polling the sockets in the set. in:
out:
ex: If processing a connect request (non-blocking mode), connection attempt failed. OOB data... more | |
Sends data on a connected socket. | |
Sends data to the endpoint node. | |
This function sets the socket options. | |
Shutdowns the connection in specific side, such as reading side, writing side, or both. In a half read situation, vm_soc_shutdown() discards the received data that the application has not yet read and any further incoming data. In a half write situation of TCP, the remaining data will be sent first, then the FIN will be sent to close the connection. | |
Creates a socket. | |
Creates a socket with a particular bearer, as specified by the data_account_id. In contrast, the vm_soc_socket() creates a socket with the latest opened bearer. |
Macro |
Description |
Refer to vm_accept. | |
IPv4. | |
Refer to vm_bind. | |
Refer to vm_closesocket. | |
Refer to vm_connect. | |
Refer to vm_getpeername. | |
Refer to vm_getsockname. | |
Refer to vm_getsockopt. | |
Refer to vm_htonl. | |
Refer to vm_htons. | |
Refer to vm_inet_addr. | |
Refer to vm_inet_ntoa. | |
Refer to vm_inet_ntop. | |
Refer to vm_inet_pton. | |
IPv6 hop-by-hop options. | |
Internet Control Message Protocol. Currently, applications are only allowed to set this type when RAW_SOCKET is used | |
Internet Group Management Protocol. | |
Dummy for IP. | |
For compatibility. | |
IPv4 encapsulation. | |
Raw IP packet. | |
TCP protocol. | |
User Datagram Protocol. | |
Refer to vm_listen. | |
Refer to vm_htonl. | |
Refer to vm_htons. | |
IPv4. | |
IPv6. | |
Refer to vm_recv. | |
Refer to vm_recvfrom. | |
Refer to vm_select. | |
Refer to vm_send. | |
Refer to vm_sendto. | |
Refer to vm_setsockopt. | |
Refer to vm_shutdown. | |
Datagram socket, UDP. | |
Stream socket, TCP. | |
Refer to vm_socket. | |
Refer to vm_socket_ex. | |
FD SET SIZE | |
The maximum length of the network socket address. |
Struct, Record, Enum |
Description |
Generic IPv4 Address structure. | |
Generic IPv6 Address structure. | |
Generic Socket Address structure. | |
IPv4 Socket Address structure. | |
IPv6 Socket Address structure. | |
Generic IPv4 Address structure. | |
Generic IPv6 Address structure. | |
Generic Socket Address structure. | |
IPv4 Socket Address structure. | |
IPv6 Socket Address structure. | |
Selects timeout structure. | |
Macros for SOC_SELECT | |
Socket address struct. | |
Socket Options | |
Socket return codes. The negative values stand for errors. | |
Shutdown(2), specified by Posix.1g. |