#!/usr/bin/perl -IGoogleProxy

use lib "GoogleProxy";
use strict;
# use warnings;

BEGIN{
	push @INC, "C:\\Users\\Enger\\Documents\\NetBeansProjects\\BuzzerProxy\\src\\googleproxy\\GoogelProxy";
	push @INC, "GoogleProxy";
}

#########################################
##### Author:		Sebastian Enger / B.Sc
##### CopyRight:	Buzzer
##### LastModified	26.1.2008
##### Function:		Hauptdatei f�r GoogleProxy
##### Todo:		for statt foreach: ist schneller
##### Hint:		minimum StringLength of one Result is about 70 Chars long
########################################

# root: -20 <> 20 | normal: 0 <> 20
my $ServicePriority = "-1";				
# system("renice $ServicePriority $$");

use Socket;
use IO::Select;
use Fcntl ':flock';

use LWP::UserAgent;			# perl -MCPAN -e 'force install "LWP::UserAgent"'	
use HTTP::Cookies;				# perl -MCPAN -e 'force install "HTTP::Cookies"'
use HTTP::Request;				# perl -MCPAN -e 'force install "HTTP::Request"'
use GoogleProxy::Daemon;
use GoogleProxy::IO;
use Google::Search;


use constant VERSION		=> "'GoogleProxy -v1.0.0a- 17.07.2011 @ 13.50 Uhr'";
use constant PIDFILE		=> "googleproxy-pid.txt"; unlink PIDFILE;

my $DONE					= 0;
my ($ServerIPAdress)		= `LANG=US_us ifconfig eth0`=~/inet addr:([\d.]+)/;
$ServerIPAdress				= "127.0.0.1";
my $port					= 65000;
#my $Socket					= GoogleProxy::IO->CreateHandyDistributedSocket( $ServerIPAdress, $port );
#$Socket->autoflush(0);
#&init_server(PIDFILE);	# Server als Deamon starten

#my $ReadFromClient 			= GoogleProxy::IO->readSocket($Socket);
#my ( $page, $searchquery, $filetype ) = split("###", $ReadFromClient);














