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

Function lwip_close

components/net/lwip/lwip-1.4.1/src/api/sockets.c:457–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455}
456
457int
458lwip_close(int s)
459{
460 struct lwip_sock *sock;
461 int is_tcp = 0;
462
463 LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_close(%d)\n", s));
464
465 sock = get_socket(s);
466 if (!sock) {
467 return -1;
468 }
469
470 if(sock->conn != NULL) {
471 is_tcp = netconn_type(sock->conn) == NETCONN_TCP;
472 } else {
473 LWIP_ASSERT("sock->lastdata == NULL", sock->lastdata == NULL);
474 }
475
476 netconn_delete(sock->conn);
477
478 free_socket(sock, is_tcp);
479 set_errno(0);
480 return 0;
481}
482
483int
484lwip_connect(int s, const struct sockaddr *name, socklen_t namelen)

Callers 1

pingFunction · 0.50

Calls 4

get_socketFunction · 0.70
netconn_typeEnum · 0.70
netconn_deleteFunction · 0.70
free_socketFunction · 0.70

Tested by

no test coverage detected