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);