tcp_close() — Close the connection


err_t tcp_close (struct tcp_pcb *pcb );


Closes the connection. The pcb is deallocated by the TCP code after a call to tcp_close().

Return value

The function may return ERR_MEM if no memory was available for closing the connection. If so, the application should wait and try again either by using the acknowledgment callback or the polling functionality. If the close succeeds, the function returns ERR_OK.