From 9378a8d657e52e4ae428375b933e7b9917a422f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=A3=8E?= Date: Wed, 14 Aug 2013 15:08:46 +0800 Subject: [PATCH] add gate close --- gate/main.c | 4 ++++ gate/mread.h | 1 + 2 files changed, 5 insertions(+) diff --git a/gate/main.c b/gate/main.c index 5216f46b..7eb69d60 100644 --- a/gate/main.c +++ b/gate/main.c @@ -120,6 +120,10 @@ _ctrl(struct skynet_context * ctx, struct gate * g, const void * msg, int sz) { skynet_command(ctx,"TIMEOUT","0"); return; } + if (memcmp(command, "close", i) == 0) { + mread_close_listen(g->pool); + return; + } skynet_error(ctx, "[gate] Unkown command : %s", command); } diff --git a/gate/mread.h b/gate/mread.h index 73061bc3..f44ccba2 100644 --- a/gate/mread.h +++ b/gate/mread.h @@ -7,6 +7,7 @@ struct mread_pool; struct mread_pool * mread_create(uint32_t addr, int port , int max , int buffer); void mread_close(struct mread_pool *m); +void mread_close_listen(struct mread_pool *self); int mread_poll(struct mread_pool *m , int timeout); void * mread_pull(struct mread_pool *m , int size);