ContentsIndex
PreviousUpNext
BSD Socket
Topics | Functions | Macros | Structs, Records, Enums
Description

Provides functions for the socket related operations.

Introduction

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.

Limitation

The parameter of flags in all the functions provided in this module is not used. The parameter of flags is a reserved parameter.

Group
Functions
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. 
Makes the specified socket listen to the incoming connections. 
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:

  1. If listen has been called and a connection is pending, accept will succeed.
  2. Data is available for reading (includes OOB data if VM_SOC_OOBINLINE is enabled).
  3. Connection has been closed/reset/terminated

out:

  1. If processing a connect request (non-blocking mode), connection has succeeded.
  2. Data can be sent.

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. 
Macros
Macro 
Description 
Refer to vm_accept. 
IPv4. 
bind 
Refer to vm_bind. 
Refer to vm_closesocket. 
Refer to vm_connect. 
Sets the socket ID that you want to select
Sets the socket ID that you want to select
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. 
recv 
Refer to vm_recv. 
Refer to vm_recvfrom. 
Refer to vm_select. 
send 
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. 
Structs, Records, Enums
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. 
Links
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.