You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
731 B

/* common/socket_close - Properly close a socket,
* ensuring that any data we write just before
* the close has been transmitted to the other
* side, and ignoring any data the other side
* has sent at the time the close was started.
*
* Reference:
*
* http://ia800504.us.archive.org/3/items/TheUltimateSo_lingerPageOrWhyIsMyTcpNotReliable/the-ultimate-so_linger-page-or-why-is-my-tcp-not-reliable.html
*/
#ifndef LIGHTNING_COMMON_SOCKET_CLOSE_H
#define LIGHTNING_COMMON_SOCKET_CLOSE_H
#include "config.h"
#include <stdbool.h>
/* Return false if something failed, true if
* nothing failed.
* If something failed, error is stored in
* `errno.
*/
bool socket_close(int fd);
#endif /* LIGHTNING_COMMON_SOCKET_CLOSE_H */