MXS-2122: Close listener socket on destruction
Even though directly closing the socket is not very neat in the architectural sense of things, it allows the best of both worlds: the socket is instantly closed and is open for reuse while the listener struct is still available as a reference. This change needs to be revised when the listeners are refactored into separate objects. Updated documentation to reflect the change in behavior.
This commit is contained in:
@ -1274,6 +1274,11 @@ void dcb_final_close(DCB* dcb)
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Only listeners are closed with a fd of -1
|
||||
mxb_assert(dcb->dcb_role == DCB_ROLE_SERVICE_LISTENER);
|
||||
}
|
||||
|
||||
dcb->state = DCB_STATE_DISCONNECTED;
|
||||
dcb_remove_from_list(dcb);
|
||||
|
Reference in New Issue
Block a user