public static void main(String[] args) throws IOException {
		listener = new ServerSocket(portdst);
		System.out.println("Venter paa connection paa port " + portdst );
		System.out.println("Indtast eventuel portnummer som 1. argument");
		System.out.println("paa kommando linien for andet portnr");
		sock = listener.accept();
		instream = new BufferedReader(new
		InputStreamReader(sock.getInputStream()));
		outstream = new DataOutputStream(sock.getOutputStream());
		printmenu();
		try{
			while (!(inline = instream.readLine().toUpperCase()).isEmpty()){
				
				if (inline.startsWith("DN")) {
					// ikke implimenteret
				}
				
				else if (inline.startsWith("D")){
					if (inline.equals("D"))
						IndstruktionsDisplay="";
					else
						IndstruktionsDisplay=(inline.substring(2, inline.length()));
					printmenu();
					outstream.writeBytes("DB"+"\r\n");
				}
				
				else if (inline.startsWith("T")) {
					outstream.writeBytes("T " + (tara) + " kg "+"\r\n");
					tara=brutto;
					printmenu();
				}
				
				else if (inline.startsWith("S")) {
					printmenu();
					outstream.writeBytes("S " + (brutto-tara)+ " kg " +"\r\n");
				}
				
				else if (inline.startsWith("B")) {
					// denne ordre findes
					//ikke på en fysisk vægt
					String temp= inline.substring(2,inline.length());
					brutto = Double.parseDouble(temp);
					printmenu();
					outstream.writeBytes("DB"+"\r\n");
				}
				
				else if ((inline.startsWith("Q"))) {
					System.out.println("");
					System.out.println("Program stoppet Q modtaget paa com port");
					System.in.close();
					System.out.close();
					instream.close();
					outstream.close();
					System.exit(0);
				}
			
			}
		}
		catch (Exception e) {
			System.out.println("Exception: "+e.getMessage());
		}
	}