mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +00:00
avoid close socket duplicate
This commit is contained in:
@@ -580,17 +580,21 @@ _link_node(struct ringbuffer * rb, int id, struct socket * s , struct ringbuffer
|
||||
void
|
||||
mread_close_client(struct mread_pool * self, int id) {
|
||||
struct socket * s = &self->sockets[id];
|
||||
if (s->status >= SOCKET_ALIVE && s->status != SOCKET_HALFCLOSE) {
|
||||
s->status = SOCKET_HALFCLOSE;
|
||||
try_close(self, s);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
force_close_client(struct mread_pool * self, int id) {
|
||||
struct socket * s = &self->sockets[id];
|
||||
free_buffer(&s->client);
|
||||
if (s->status >= SOCKET_ALIVE && s->status != SOCKET_HALFCLOSE) {
|
||||
s->status = SOCKET_HALFCLOSE;
|
||||
try_close(self, s);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_close_active(struct mread_pool * self) {
|
||||
|
||||
Reference in New Issue
Block a user