add gate close

This commit is contained in:
云风
2013-08-14 15:08:46 +08:00
parent b057839b3e
commit 9378a8d657
2 changed files with 5 additions and 0 deletions

View File

@@ -120,6 +120,10 @@ _ctrl(struct skynet_context * ctx, struct gate * g, const void * msg, int sz) {
skynet_command(ctx,"TIMEOUT","0"); skynet_command(ctx,"TIMEOUT","0");
return; return;
} }
if (memcmp(command, "close", i) == 0) {
mread_close_listen(g->pool);
return;
}
skynet_error(ctx, "[gate] Unkown command : %s", command); skynet_error(ctx, "[gate] Unkown command : %s", command);
} }

View File

@@ -7,6 +7,7 @@ struct mread_pool;
struct mread_pool * mread_create(uint32_t addr, int port , int max , int buffer); struct mread_pool * mread_create(uint32_t addr, int port , int max , int buffer);
void mread_close(struct mread_pool *m); void mread_close(struct mread_pool *m);
void mread_close_listen(struct mread_pool *self);
int mread_poll(struct mread_pool *m , int timeout); int mread_poll(struct mread_pool *m , int timeout);
void * mread_pull(struct mread_pool *m , int size); void * mread_pull(struct mread_pool *m , int size);