2017 © Pedro Peláez
 

library userv

Micro PHP library to build a socket server

image

devster/userv

Micro PHP library to build a socket server

  • Monday, January 6, 2014
  • by devster
  • Repository
  • 2 Watchers
  • 3 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Userv

Latest Stable Version Build Status, (*1)

Micro PHP Socket server library, (*2)

! work in progress! For now only tested on ubuntu, PHP 5.4 This lib should be used only in CLI, because of the use of pcntl_fork, (*3)

Quick usage

Create a php file and copy the code below., (*4)

require 'vendor/autoload.php';

use Userv\Server;
use Userv\Connection\TelnetConnection;

$serv = new Server('127.0.0.1', 23);
$serv
    ->setConnection(new TelnetConnection)
    ->setHandler(function($conn) {
        $conn->writeln('Hello, welcome on this telnet server, bouya!');
        $name = $conn->ask('What\'s your name? : ');
        $conn->writeln('Your name is '.$name);
    })
;

$serv->run();

Then run this file as CLI script: sudo php myserver.php., (*5)

Now open a new terminal and try telnet localhost., (*6)

The Versions

06/01 2014

dev-master

9999999-dev https://github.com/devster/userv

Micro PHP library to build a socket server

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • ext-pcntl *

 

micro library server socket