mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
23
common/socket_close.h
Normal file
23
common/socket_close.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* 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 */
|
||||
Reference in New Issue
Block a user