public void listenSocket()
	{

		try
		{
			server = new ServerSocket( 80 );
		}
		catch( IOException e )
		{
			System.out.println( "Could not listen on port 80" );
			System.exit( -1 );
		}
		while( true )
		{
			try
			{
				client = server.accept();
			}
			catch( IOException e )
			{
				System.out.println( "Accept failed: 80" );
				System.exit( -1 );
			}

			try
			{
				socketNum = (int) (Math.random() * MAX_PORT_NUM);
				while( socketNum.intValue() < 80 )
				{
					socketNum = (int) (Math.random() * MAX_PORT_NUM);
				}
				usedPorts.add( socketNum );
				in = new BufferedReader( new InputStreamReader( client.
						getInputStream() ) );
				out = new PrintWriter( client.getOutputStream(), true );
				System.out.println( "Po uruchomieniu wątku" );
			}
			catch( IOException e )
			{
				System.out.println( "Accept failed: 80" );
				System.exit( -1 );
			}

			try
			{
				//line = "NP " + socketNum;
				line = "404";
				out.println( line );
			}
			catch( Exception e )
			{
				System.out.println( "Read failed" );
				System.exit( -1 );
			}
		}
	}