public void startMessageListening() throws InterruptedException, ChannelError {
		Runnable runnable = new Runnable() {
			@Override
			public void run() {
				while(stayConnected) {
			        if (channel.hasEvents()) {
			        	try {
							event = channel.nextEvent();
						} catch (ChannelError | InterruptedException e) {
							listener.systemMessage("Channel error "+e);
							
						}
			        	if(event instanceof ChannelData) {
			        		if(event.isUtf8Content()) {
			        			listener.messageRecieved(event.getString());
			        		}
			        		else {
			        			listener.messageRecieved("Recieved binary data, use orignial library to handle that");
			        		}
			        	}
			        	else {
			        		listener.signalRecieved(event.getString());
			        	}
			        } 
			    }
				
			}
		};
		thread = new Thread(runnable);
		thread.start();
	}