public Network(String server, int port) throws ServerNotFoundException,
			SocketBusyException, IOException {

		if (server != null) {
			Socket output;
			try {
				output = new Socket(server, port);
			} catch (UnknownHostException e) {
				throw new ServerNotFoundException();
			} catch (IOException e) {
				throw new SocketBusyException();
			}
			peer = output;
		}
		
		else {
			ServerSocket listen;
			try {
				listen = new ServerSocket(port);
			} catch (IOException e) {
				throw new SocketBusyException();
			}
			Socket input;
			try {
				input = listen.accept();
			} catch (IOException e) {
				throw e;
			}
			peer = input;
		}

		out = new ObjectOutputStream(peer.getOutputStream());
		in = new ObjectInputStream(peer.getInputStream());

		/*
		 * out.writeObject("hi"); out.flush();
		 */
	}