PHP Classes
Icontem

File: example_thread.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Cesar D. Rodas  >  DNServer  >  example_thread.php  
File: example_thread.php
Role: Example script
Content type: text/plain
Description: Example of how to implemente the Threaded server...
Class: DNServer
Implement a DNS server in pure PHP
 

Contents

Class file image Download
<?
/*
**    DNServer (Public Domain)
**    Cesar Rodas <saddor@guaranix.org>
**
**    The Idea is to give a simple way to handle DNS querys and retrives an IP.
**    This project could be used as a DNS Trafic Balancer to mirrow sites with a 
**    close geografic position, of course with a IP2Country Module.
****************************************************************************************
**    La idea es dar una manera de manejar las peticiones de DNS y retornar un IP.
**    El proyecto puede ser usado como un Balanceador de Trafico hacia sitios espejos 
**    con una posicion geografica cercana, desde luego que con un modulo de IP2Country.
**
*/

/*
**    PAY ATENTION! THIS "THREADED" DNS USES THE FORK PROCESS. FORK IS ONLY AVALIABLE
**    ON UNIX LIKE OS (Linux, FreeBSD, MacOS, OpenBSD, and others).
*/    

include "Fork.php";
include 
"DNServer.php";
include 
"DNServer_thread.php";

function 
dnshandler($dominio,$tipo)
{
    return 
"127.0.0.1";
}

$dns = new DNServer_thread("dnshandler""127.0.0.1" );


?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products