PHP Classes

File: tests/manually/ServerTestManually.php

Recommend this page to a friend!
  Classes of Maik Greubel   PHP Generics   tests/manually/ServerTestManually.php   Download  
File: tests/manually/ServerTestManually.php
Role: Unit test script
Content type: text/plain
Description: Unit test for manually testing ServerSocket
Class: PHP Generics
Framework for accessing streams, sockets and logs
Author: By
Last change: Update of tests/manually/ServerTestManually.php
Date: 7 months ago
Size: 641 bytes
 

Contents

Class file image Download
<?php
set_include_path
(get_include_path() . PATH_SEPARATOR . realpath('../../src'));

require_once
'Generics/Socket/Socket.php';
require_once
'Generics/Socket/ServerSocket.php';
require_once
'Generics/Socket/ServiceCallback.php';
require_once
'Generics/Socket/Endpoint.php';
require_once
'Generics/Socket/SocketException.php';

require
'./TestServerSocketCallback.php';

use
Generics\Socket\ServerSocket;
use
Generics\Socket\Endpoint;

use
tests\manually\TestServerSocketCallback;

$serverEndpoint = new Endpoint('127.0.0.1', 8421);
$server = new ServerSocket($serverEndpoint);
$server->serve(new TestServerSocketCallback($serverEndpoint));