mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-03 13:28:44 +00:00
Handle MG_EV_CLOSE in examples
PUBLISHED_FROM=57c62a4123a54ecb455dbf91f3fe562fb0cf2ec2
This commit is contained in:
1 parent
e99088348d
commit
e62dc8f3b2
5 files changed
+34
-5
No files matched your search
@@ -28,6 +28,12 @@ static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
|
||||
nc->flags |= MG_F_SEND_AND_CLOSE;
|
||||
s_exit_flag = 1;
|
||||
break;
|
||||
case MG_EV_CLOSE:
|
||||
if (s_exit_flag == 0) {
|
||||
printf("Server closed connection\n");
|
||||
s_exit_flag = 1;
|
||||
};
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user