|
int | socket (long domain, long type, long protocol) |
| create an endpoint for communication The socket function creates a socket that is bound to a specific transport service provider. This function is called by the application layer to obtain a socket handle.
|
|
long | closesocket (long sd) |
| The socket function closes a created socket.
|
|
long | accept (long sd, sockaddr *addr, socklen_t *addrlen) |
| accept a connection on a socket: This function is used with connection-based socket types (SOCK_STREAM). It extracts the first connection request on the queue of pending connections, creates a new connected socket, and returns a new file descriptor referring to that socket. The newly created socket is not in the listening state. The original socket sd is unaffected by this call. The argument sd is a socket that has been created with socket(), bound to a local address with bind(), and is listening for connections after a listen(). The argument addr is a pointer to a sockaddr structure. This structure is filled in with the address of the peer socket, as known to the communications layer. The exact format of the address returned addr is determined by the socket's address family. The addrlen argument is a value-result argument: it should initially contain the size of the structure pointed to by addr, on return it will contain the actual length (in bytes) of the address returned.
|
|
long | bind (long sd, const sockaddr *addr, long addrlen) |
| assign a name to a socket This function gives the socket the local address addr. addr is addrlen bytes long. Traditionally, this is called when a socket is created with socket, it exists in a name space (address family) but has no name assigned. It is necessary to assign a local address before a SOCK_STREAM socket may receive connections.
|
|
long | listen (long sd, long backlog) |
| listen for connections on a socket The willingness to accept incoming connections and a queue limit for incoming connections are specified with listen(), and then the connections are accepted with accept. The listen() call applies only to sockets of type SOCK_STREAM The backlog parameter defines the maximum length the queue of pending connections may grow to.
|
|
int | gethostbyname (char *hostname, unsigned short usNameLen, unsigned long *out_ip_addr) |
| Get host IP by name. Obtain the IP Address of machine on network, by its name.
|
|
long | connect (long sd, const sockaddr *addr, long addrlen) |
| initiate a connection on a socket Function connects the socket referred to by the socket descriptor sd, to the address specified by addr. The addrlen argument specifies the size of addr. The format of the address in addr is determined by the address space of the socket. If it is of type SOCK_DGRAM, this call specifies the peer with which the socket is to be associated; this address is that to which datagrams are to be sent, and the only address from which datagrams are to be received. If the socket is of type SOCK_STREAM, this call attempts to make a connection to another socket. The other socket is specified by address, which is an address in the communications space of the socket. Note that the function implements only blocking behavior thus the caller will be waiting either for the connection establishment or for the connection establishment failure.
|
|
int | select (long nfds, fd_set *readsds, fd_set *writesds, fd_set *exceptsds, struct timeval *timeout) |
| Monitor socket activity Select allow a program to monitor multiple file descriptors, waiting until one or more of the file descriptors become "ready" for some class of I/O operation.
|
|
int | setsockopt (long sd, long level, long optname, const void *optval, socklen_t optlen) |
| set socket options This function manipulate the options associated with a socket. Options may exist at multiple protocol levels; they are always present at the uppermost socket level. When manipulating socket options the level at which the option resides and the name of the option must be specified. To manipulate options at the socket level, level is specified as SOL_SOCKET. To manipulate options at any other level the protocol number of the appropriate protocol controlling the option is supplied. For example, to indicate that an option is to be interpreted by the TCP protocol, level should be set to the protocol number of TCP; The parameters optval and optlen are used to access optval - use for setsockopt(). For getsockopt() they identify a buffer in which the value for the requested option(s) are to be returned. For getsockopt(), optlen is a value-result parameter, initially containing the size of the buffer pointed to by option_value, and modified on return to indicate the actual size of the value returned. If no option value is to be supplied or returned, option_value may be NULL.
|
|
int | getsockopt (long sd, long level, long optname, void *optval, socklen_t *optlen) |
| set socket options This function manipulate the options associated with a socket. Options may exist at multiple protocol levels; they are always present at the uppermost socket level. When manipulating socket options the level at which the option resides and the name of the option must be specified. To manipulate options at the socket level, level is specified as SOL_SOCKET. To manipulate options at any other level the protocol number of the appropriate protocol controlling the option is supplied. For example, to indicate that an option is to be interpreted by the TCP protocol, level should be set to the protocol number of TCP; The parameters optval and optlen are used to access optval - use for setsockopt(). For getsockopt() they identify a buffer in which the value for the requested option(s) are to be returned. For getsockopt(), optlen is a value-result parameter, initially containing the size of the buffer pointed to by option_value, and modified on return to indicate the actual size of the value returned. If no option value is to be supplied or returned, option_value may be NULL.
|
|
int | recv (long sd, void *buf, long len, long flags) |
| function receives a message from a connection-mode socket
|
|
int | recvfrom (long sd, void *buf, long len, long flags, sockaddr *from, socklen_t *fromlen) |
| read data from socket function receives a message from a connection-mode or connectionless-mode socket. Note that raw sockets are not supported.
|
|
int | send (long sd, const void *buf, long len, long flags) |
| Write data to TCP socket This function is used to transmit a message to another socket.
|
|
int | sendto (long sd, const void *buf, long len, long flags, const sockaddr *to, socklen_t tolen) |
| Write data to TCP socket This function is used to transmit a message to another socket.
|
|
int | mdnsAdvertiser (unsigned short mdnsEnabled, char *deviceServiceName, unsigned short deviceServiceNameLength) |
| Set CC3000 in mDNS advertiser mode in order to advertise itself.
|
|