Transport protocol abstraction layer. More...
#include "core/net.h"
#include "http/http_client.h"
#include "http/http_client_transport.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL HTTP_TRACE_LEVEL |
Functions | |
error_t | httpClientOpenConnection (HttpClientContext *context) |
Open network connection. More... | |
error_t | httpClientEstablishConnection (HttpClientContext *context, const IpAddr *serverIpAddr, uint16_t serverPort) |
Establish network connection. More... | |
error_t | httpClientShutdownConnection (HttpClientContext *context) |
Shutdown network connection. More... | |
void | httpClientCloseConnection (HttpClientContext *context) |
Close network connection. More... | |
error_t | httpClientSendData (HttpClientContext *context, const void *data, size_t length, size_t *written, uint_t flags) |
Send data using the relevant transport protocol. More... | |
error_t | httpClientReceiveData (HttpClientContext *context, void *data, size_t size, size_t *received, uint_t flags) |
Receive data using the relevant transport protocol. More... | |
error_t | httpClientSaveSession (HttpClientContext *context) |
Save TLS session. More... | |
Detailed Description
Transport protocol abstraction layer.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file http_client_transport.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL HTTP_TRACE_LEVEL |
Definition at line 32 of file http_client_transport.c.
Function Documentation
◆ httpClientCloseConnection()
void httpClientCloseConnection | ( | HttpClientContext * | context | ) |
Close network connection.
- Parameters
-
[in] context Pointer to the HTTP client context
Definition at line 200 of file http_client_transport.c.
◆ httpClientEstablishConnection()
error_t httpClientEstablishConnection | ( | HttpClientContext * | context, |
const IpAddr * | serverIpAddr, | ||
uint16_t | serverPort | ||
) |
Establish network connection.
- Parameters
-
[in] context Pointer to the HTTP client context [in] serverIpAddr IP address of the HTTP server to connect to [in] serverPort TCP port number that will be used to establish the connection
- Returns
- Error code
Definition at line 129 of file http_client_transport.c.
◆ httpClientOpenConnection()
error_t httpClientOpenConnection | ( | HttpClientContext * | context | ) |
Open network connection.
- Parameters
-
[in] context Pointer to the HTTP client context
- Returns
- Error code
Definition at line 50 of file http_client_transport.c.
◆ httpClientReceiveData()
error_t httpClientReceiveData | ( | HttpClientContext * | context, |
void * | data, | ||
size_t | size, | ||
size_t * | received, | ||
uint_t | flags | ||
) |
Receive data using the relevant transport protocol.
- Parameters
-
[in] context Pointer to the HTTP client context [out] data Buffer into which received data will be placed [in] size Maximum number of bytes that can be received [out] received Number of bytes that have been received [in] flags Set of flags that influences the behavior of this function
- Returns
- Error code
Definition at line 264 of file http_client_transport.c.
◆ httpClientSaveSession()
error_t httpClientSaveSession | ( | HttpClientContext * | context | ) |
Save TLS session.
- Parameters
-
[in] context Pointer to the HTTP client context
- Returns
- Error code
Definition at line 294 of file http_client_transport.c.
◆ httpClientSendData()
error_t httpClientSendData | ( | HttpClientContext * | context, |
const void * | data, | ||
size_t | length, | ||
size_t * | written, | ||
uint_t | flags | ||
) |
Send data using the relevant transport protocol.
- Parameters
-
[in] context Pointer to the HTTP client context [in] data Pointer to a buffer containing the data to be transmitted [in] length Number of bytes to be transmitted [out] written Actual number of bytes written (optional parameter) [in] flags Set of flags that influences the behavior of this function
- Returns
- Error code
Definition at line 230 of file http_client_transport.c.
◆ httpClientShutdownConnection()
error_t httpClientShutdownConnection | ( | HttpClientContext * | context | ) |
Shutdown network connection.
- Parameters
-
[in] context Pointer to the HTTP client context
- Returns
- Error code
Definition at line 163 of file http_client_transport.c.