@Override
	public RoomInfo emitEvent(String event, Jsonable data) throws NetworkMethodException {
		Socket socket = null;
		ObjectOutputStream oOut = null;
		ObjectInputStream oIn = null;
		RoomInfo result = null;
		Object request, response;
		try {
			socket = new Socket(Constants.SERVER_IP, Constants.SERVER_PORT);
			oOut = new ObjectOutputStream(new BufferedOutputStream(
					socket.getOutputStream()));

			request = toRequest(event,data);
			
			oOut.writeObject(request);
			oOut.flush();

			oIn = new ObjectInputStream(new BufferedInputStream(
					socket.getInputStream()));
			response = oIn.readObject();
			result = responseToRoomInfo(response);

		} catch (UnknownHostException e) {
			throw new NetworkMethodException(e);
		} catch (IOException e) {
			throw new NetworkMethodException(e);
		} catch (ClassNotFoundException e) {
			throw new NetworkMethodException(e);
		} finally {
			freeResources(socket, oIn, oOut);
		}
		return result;
	}