public ServerSocketHandler(ComsLibAdapter comsLibAdapter) {
		this.comsLibAdapter = comsLibAdapter;
		comsLibAdapter.addEventListener(new ComsLibAdapterEventListener() {
			@Override
			public void onEvent(ComsLibAdapterEvent e) {
				if (channelCtx == null) {
					// don't do anything if the channel hasn't been initialized yet
					return;
				}
				if (!hasAuthenticated()) {
					// don't send anything if they haven't authenticated yet
					return;
				}
				if (e.getClass().getSimpleName().equals("ChannelAddedEvent")) {
					ChannelAddedEvent event = (ChannelAddedEvent) e;
					ArrayList<ReturnObj> returnObjects = new ArrayList<ReturnObj>();
					Hashtable<String,Object> payload = new Hashtable<String,Object>();
					payload.put("action", "connection");
					payload.put("id", event.getChannelId());
					payload.put("name", event.getName());
					returnObjects.add(new ReturnObj(0, null, payload));
					JSONObject[] tmpArray = generateReturnObjArray(returnObjects);
					channelCtx.writeAndFlush(new TextWebSocketFrame(new JSONArray(tmpArray).toString()));
				}
				else if (e.getClass().getSimpleName().equals("ChannelRemovedEvent")) {
					ChannelRemovedEvent event = (ChannelRemovedEvent) e;
					ArrayList<ReturnObj> returnObjects = new ArrayList<ReturnObj>();
					Hashtable<String,Object> payload = new Hashtable<String,Object>();
					payload.put("action", "disconnection");
					payload.put("id", event.getChannelId());
					returnObjects.add(new ReturnObj(0, null, payload));
					JSONObject[] tmpArray = generateReturnObjArray(returnObjects);
					channelCtx.writeAndFlush(new TextWebSocketFrame(new JSONArray(tmpArray).toString()));
				}
				else if (e.getClass().getSimpleName().equals("ChannelsToRoomEvent")) {
					ChannelsToRoomEvent event = (ChannelsToRoomEvent) e;
					ArrayList<ReturnObj> returnObjects = new ArrayList<ReturnObj>();
					Hashtable<String,Object> payload = new Hashtable<String,Object>();
					payload.put("action", "linking");
					payload.put("ids", event.getChannelIds());
					returnObjects.add(new ReturnObj(0, null, payload));
					JSONObject[] tmpArray = generateReturnObjArray(returnObjects);
					channelCtx.writeAndFlush(new TextWebSocketFrame(new JSONArray(tmpArray).toString()));
				}
				else if (e.getClass().getSimpleName().equals("ChannelToHoldingEvent")) {
					ChannelToHoldingEvent event = (ChannelToHoldingEvent) e;
					ArrayList<ReturnObj> returnObjects = new ArrayList<ReturnObj>();
					Hashtable<String,Object> payload = new Hashtable<String,Object>();
					// send linking event with just the one channel
					payload.put("action", "linking");
					payload.put("ids", new int[]{event.getChannelId()});
					returnObjects.add(new ReturnObj(0, null, payload));
					JSONObject[] tmpArray = generateReturnObjArray(returnObjects);
					channelCtx.writeAndFlush(new TextWebSocketFrame(new JSONArray(tmpArray).toString()));
				}
			}
		});
	}