MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / netconn_send

Function netconn_send

components/net/lwip/lwip-2.1.2/src/api/api_lib.c:940–957  ·  view source on GitHub ↗

* @ingroup netconn_udp * Send data over a UDP or RAW netconn (that is already connected). * * @param conn the UDP or RAW netconn over which to send data * @param buf a netbuf containing the data to send * @return ERR_OK if data was sent, any other err_t on error */

Source from the content-addressed store, hash-verified

938 * @return ERR_OK if data was sent, any other err_t on error
939 */
940err_t
941netconn_send(struct netconn *conn, struct netbuf *buf)
942{
943 API_MSG_VAR_DECLARE(msg);
944 err_t err;
945
946 LWIP_ERROR("netconn_send: invalid conn", (conn != NULL), return ERR_ARG;);
947
948 LWIP_DEBUGF(API_LIB_DEBUG, ("netconn_send: sending %"U16_F" bytes\n", buf->p->tot_len));
949
950 API_MSG_VAR_ALLOC(msg);
951 API_MSG_VAR_REF(msg).conn = conn;
952 API_MSG_VAR_REF(msg).msg.b = buf;
953 err = netconn_apimsg(lwip_netconn_do_send, &API_MSG_VAR_REF(msg));
954 API_MSG_VAR_FREE(msg);
955
956 return err;
957}
958
959/**
960 * @ingroup netconn_tcp

Callers 4

netconn_sendtoFunction · 0.70
lwip_sendmsgFunction · 0.70
lwip_sendtoFunction · 0.70
udpecho_entryFunction · 0.50

Calls 1

netconn_apimsgFunction · 0.70

Tested by 1

udpecho_entryFunction · 0.40