@Override
public void run() {
try {
while (!Thread.currentThread().isInterrupted()) {
SocketConnector connector = new DefaultSocketConnector(address, port, 0, reconnectionDelay);
connector.setExceptionHandler(this);
connector.setSocketFactory(SocketFactory.getDefault());
try {
connectorTask = getContext().getExecutorService().submit(connector);
} catch (RejectedExecutionException e) {
connectorTask = null;