Add a close event for sockets

Signed-off-by: Alexander Cogneau <alexander.cogneau@hotmail.be>