| 455 | } |
| 456 | |
| 457 | int |
| 458 | lwip_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 | |
| 483 | int |
| 484 | lwip_connect(int s, const struct sockaddr *name, socklen_t namelen) |
no test coverage detected