Change the socket close callback.