Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
HttpSocket
This module performs all HTTP socket operations. More...
Functions | |
| int | OpenTCPServerSocket (unsigned int uiPortNum) |
| Creates a TCP socket and binds to it. | |
| int | CreateTCPServerSocket (unsigned int uiPortNum) |
| Creates a TCP server socket. | |
| int | CloseTCPServerSocket (int iSockDesc) |
| Closes TCP server socket. | |
| int | CreateTCPClientSocket (int iSockDesc) |
| Accepts the client socket. | |
| int | CloseTCPClientSocket (int iSockDesc) |
| Closes TCP client socket when the Http connection with that client is closed. | |
| int | ClientSocketSend (long socket, char *buffer, unsigned int len) |
| Sends over the socket to a specific client. | |
Detailed Description
This module performs all HTTP socket operations.
Function Documentation
| int ClientSocketSend | ( | long | socket, |
| char * | buffer, | ||
| unsigned int | len | ||
| ) |
Sends over the socket to a specific client.
In non blocking socket type, it keeps looping till send is success
- Parameters:
-
socket is the handle obtained from CreateTCPClientSocket buffer is the pointer to the data to be sent len is the length of the data to be sent
This function 1. Calls send and keeps trying as long as the return is SL_EAGAIN.
- Returns:
- length successfully sent if it was a success error code if there was a failure.
It will not return an error if simplelink returns SL_EAGAIN. Instead it will keep trying till it succeeds.
Definition at line 216 of file HttpSocket.cpp.
| int CloseTCPClientSocket | ( | int | iSockDesc ) |
Closes TCP client socket when the Http connection with that client is closed.
- Parameters:
-
iSockDesc is the socket ID obtained from CreateTCPServerSocket
This function 1. Calls sl_close. Tries 3 times before returning error
- Returns:
- 0 if success -1 if error
Definition at line 187 of file HttpSocket.cpp.
| int CloseTCPServerSocket | ( | int | iSockDesc ) |
Closes TCP server socket.
- Parameters:
-
iSockDesc is the socket ID obtained from CreateTCPServerSocket
This function 1. Calls sl_close. Tries 3 times before returning error
- Returns:
- 0 if success -1 if error
Definition at line 128 of file HttpSocket.cpp.
| int CreateTCPClientSocket | ( | int | iSockDesc ) |
Accepts the client socket.
Sets it to blocking with receive timeout.
- Parameters:
-
iSockDesc is the socket ID obtained from CreateTCPServerSocket
This function 1. Accepts the client socket. 2. Sets to blocking mode with RECV timeout
- Returns:
- socket handler is returned after the SockID is put in listening state
Definition at line 156 of file HttpSocket.cpp.
| int CreateTCPServerSocket | ( | unsigned int | uiPortNum ) |
Creates a TCP server socket.
It calls OpenTCPServerSocket.
- Parameters:
-
uiPortNum is the port number to bind to
This function 1. Creates a TCP socket and binds to it 2. Sets the socket options
- Returns:
- Soceket Descriptor, < 1 if error.
Definition at line 98 of file HttpSocket.cpp.
| int OpenTCPServerSocket | ( | unsigned int | uiPortNum ) |
Creates a TCP socket and binds to it.
- Parameters:
-
uiPortNum is the port number to bind to
This function 1. Creates a TCP socket and binds to it
- Returns:
- Soceket Descriptor, < 1 if error.
Definition at line 36 of file HttpSocket.cpp.
Generated on Tue Jul 12 2022 22:22:39 by
1.7.2