public static void main(String[] args) {

		PeerInfo info = new PeerInfo("Peer 0", 6000, 3);
		info.setRessourceManager(new RessourceManager());
		info.getRessourceManager().addRessource("String 1", "Some value");
		info.setFirstPeer("localhost", 6001);

		PeerClient client = new PeerClient(info);

		try {
			client.startPeer();
		} catch (IOException e1) {
			e1.printStackTrace();
		}

		try {
			// For the next tick at least one other peer is required
			// which is more likely after 5 seconds
			Thread.sleep(5000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		client.oneToAllMessage("Peer 0 says hello");

		String nodeName = new String("Peer 2");
		System.err.println("Looking for " + nodeName);
		Node n = client.findPeerInNetwork(nodeName);
		if (n == null) {
			System.err.println("Could not find " + nodeName);
		} else {
			System.err.println("Found " + nodeName + " at: " + n);
			try {
				SingleTcpConnection con = client.oneToOneMessage(nodeName);
				System.err.println("Main " + con.isConnected());
				con.closeConnection();
				System.err.println("Main " + con.isConnected());
			} catch (UnknownHostException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}

		nodeName = new String("Peer 42");
		System.err.println("Looking for " + nodeName);
		n = null;
		n = client.findPeerInNetwork(nodeName);
		if (n == null) {
			System.err.println("Could not find " + nodeName);
		} else {
			System.err.println("Found " + nodeName + " at: " + n);
			try {
				SingleTcpConnection con = client.oneToOneMessage(nodeName);
				System.err.println("Main " + con.isConnected());
				con.closeConnection();
				System.err.println("Main " + con.isConnected());
			} catch (UnknownHostException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}

		// Object ress = null;
		// try {
		// ress = client.findRessource("Ressource 1");
		// } catch (UnknownHostException e) {
		// e.printStackTrace();
		// } catch (ClassNotFoundException e) {
		// e.printStackTrace();
		// } catch (IOException e) {
		// e.printStackTrace();
		// }
		// System.out.println("Main " + ress);
	}