LwIP + 0/3 examples
CodeScope will show references to tcp_connect() from the following samples and libraries:
Examples
STM32469I_EVAL
Applications
LwIP
STM324x9I_EVAL
Applications
LwIP
STM324xG_EVAL
Applications
LwIP
 
Symbols
loading...
Files
loading...

tcp_connect() function

Connects to another host. The function given as the "connected" argument will be called when the connection has been established. Sets up the pcb to connect to the remote host and sends the initial SYN segment which opens the connection. The tcp_connect() function returns immediately; it does not wait for the connection to be properly setup. Instead, it will call the function specified as the fourth argument (the "connected" argument) when the connection is established. If the connection could not be properly established, either because the other host refused the connection or because the other host didn't answer, the "err" callback function of this pcb (registered with tcp_err, see below) will be called. The tcp_connect() function can return ERR_MEM if no memory is available for enqueueing the SYN segment. If the SYN indeed was enqueued successfully, the tcp_connect() function returns ERR_OK.

Syntax

err_t tcp_connect (struct tcp_pcb *pcb,     const ip_addr_t *ipaddr,     u16_t port,     tcp_connected_fn connected);
Implemented in tcp.c:1066

Arguments

pcb

the tcp_pcb used to establish the connection

ipaddr

the remote ip address to connect to

port

the remote tcp port to connect to

connected

callback function to call when connected (on error, the err calback will be called)

Return value

ERR_VAL if invalid arguments are given ERR_OK if connect request has been sent other err_t values if connect request couldn't be sent

Examples

tcp_connect() is referenced by 3 libraries and example projects.

References

LocationReferrerText
tcp.c:1067
tcp_connect(struct tcp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port,
tcp.h:461
err_t tcp_connect (struct tcp_pcb *pcb, const ip_addr_t *ipaddr,
api_msg.c:1379lwip_netconn_do_connect()
err = tcp_connect(msg->conn->pcb.tcp, API_EXPR_REF(msg->msg.bc.ipaddr),

Call Tree

Functions calling tcp_connect()
Functions called by tcp_connect()
all items filtered out
tcp_connect()
Type of tcp_connect()
tcp_connect()