PHP Classes

File: src/Generics/Socket/ServiceCallback.php

Recommend this page to a friend!
  Classes of Maik Greubel   PHP Generics   src/Generics/Socket/ServiceCallback.php   Download  
File: src/Generics/Socket/ServiceCallback.php
Role: Class source
Content type: text/plain
Description: Server socket callback interface
Class: PHP Generics
Framework for accessing streams, sockets and logs
Author: By
Last change: Update of src/Generics/Socket/ServiceCallback.php
Date: 2 months ago
Size: 844 bytes
 

Contents

Class file image Download
<?php

/**
 * This file is part of the PHP Generics package.
 *
 * @package Generics
 */
namespace Generics\Socket;

/**
 * This abstract class is the blueprint for implementing a service callback
 *
 * @author Maik <greubel@nkey.de>
 *
 */
abstract class ServiceCallback
{

   
/**
     * Endpoint
     *
     * @var Endpoint endpoint
     */
   
private $serviceEndpoint;

   
/**
     * Create a new service callback instance
     *
     * @param Endpoint $endPoint
     * The endpoint
     */
   
public function __construct(Endpoint $endPoint)
    {
       
$this->serviceEndpoint = $endPoint;
    }

   
/**
     * Any implementor must provide such a functions
     *
     * @return boolean true in case of service should keep on running, false if it shall stop
     */
   
abstract public function callback(Socket $socket);
}