PHP Classes

File: example.md5online.php

Recommend this page to a friend!
  Classes of Pedro Vargas   pserver   example.md5online.php   Download  
File: example.md5online.php
Role: Example script
Content type: text/plain
Description: MD5 Online example pserver
Class: pserver
Handle TCP socket server connections
Author: By
Last change: Update example
Date: 14 years ago
Size: 995 bytes
 

Contents

Class file image Download
<?
/**
 * MD5 Online
 *
 * Thiss Class in a example of a Server create using class pserver
 *
 * @package pserver
 * @subpackage pserver.example
 * @author Pedro Vargas (deer@deerme.org) http://deerme.org
 * @version 0.2
 * @licence GNU Free Documentation License (FDL)
 */

require('pserver.class.php');

 
class
md5server extends pserver
{
   
/**
    * Function responsible for managing the customer in read
    * In this example reads and writes in an array
    */
   
function read($client)
    {
       
$this->data[ $client['n'] ] = md5(trim(@socket_read($client['socket'], $this->bufferin, ( $this->socketbinary ? PHP_BINARY_READ : PHP_NORMAL_READ ) )))."\n\r";
    }
   
}


$server = new md5server('0','10066');
$server->welcome_send = true;
$server->welcome_data = $server->_colorshell(32 , "Welcome to MD5 Online Server\n\r").$server->_colorshell(36 , "this is an example of using the class server pserver").$server->_colorshell(37,"\n\r");
$server->start();

?>