A kill simply closes your socket to the ircd, there in tells the client that you disconnected. Id simply run a timer ever so often to check if your $status if your connected it equals "connected" else reconnect.