mirror of
https://github.com/status-im/miniupnp.git
synced 2025-01-18 18:31:15 +00:00
handle socket close
This commit is contained in:
parent
3fd57ddbb4
commit
b8d1d79224
@ -1,5 +1,6 @@
|
|||||||
/* $Id: $ */
|
/* $Id: $ */
|
||||||
/* MiniUPnP project
|
/* vim: shiftwidth=4 tabstop=4 noexpandtab
|
||||||
|
* MiniUPnP project
|
||||||
* (c) 2016 Thomas Bernard
|
* (c) 2016 Thomas Bernard
|
||||||
* website : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
* website : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
||||||
* This software is subject to the conditions detailed
|
* This software is subject to the conditions detailed
|
||||||
@ -66,6 +67,8 @@ int main(int argc, char * * argv)
|
|||||||
if(errno == EINTR) continue;
|
if(errno == EINTR) continue;
|
||||||
perror("read");
|
perror("read");
|
||||||
break;
|
break;
|
||||||
|
} else if(n == 0) {
|
||||||
|
printf("Socket closed\n");
|
||||||
}
|
}
|
||||||
printf("%d bytes read\n", (int)n);
|
printf("%d bytes read\n", (int)n);
|
||||||
printresponse(buffer, (int)n);
|
printresponse(buffer, (int)n);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user