projects
/
gapil.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Altre piccole correzioni
[gapil.git]
/
listati
/
is_closing.c
1
int is_closing(int sock)
2
{
3
struct tcp_info info;
4
socklen_t len = sizeof(info);
5
if (getsockopt(sock, SOL_TCP, TCP_INFO, &info, &len) != -1) {
6
if (info.tcpi_state == TCP_CLOSE ||
7
info.tcpi_state == TCP_CLOSE_WAIT ||
8
info.tcpi_state == TCP_CLOSING) {
9
return 1;
10
} else {
11
return 0;
12
}
13
} else {
14
return errno;
15
}
16
}