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

Function netconn_sendto

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

* @ingroup netconn_udp * Send data (in form of a netbuf) to a specific remote IP address and port. * Only to be used for UDP and RAW netconns (not TCP). * * @param conn the netconn over which to send data * @param buf a netbuf containing the data to send * @param addr the remote IP address to which to send the data * @param port the remote port to which to send the data * @return ERR_OK if

Source from the content-addressed store, hash-verified

919 * @return ERR_OK if data was sent, any other err_t on error
920 */
921err_t
922netconn_sendto(struct netconn *conn, struct netbuf *buf, const ip_addr_t *addr, u16_t port)
923{
924 if (buf != NULL) {
925 ip_addr_set(&buf->addr, addr);
926 buf->port = port;
927 return netconn_send(conn, buf);
928 }
929 return ERR_VAL;
930}
931
932/**
933 * @ingroup netconn_udp

Callers 1

snmp_sendtoFunction · 0.50

Calls 2

ip_addr_setFunction · 0.85
netconn_sendFunction · 0.70

Tested by

no test coverage detected