2017 © Pedro Peláez
 

library simple-socket

This library can create socket client simply. It is written by php native socket functions.

image

osushi/simple-socket

This library can create socket client simply. It is written by php native socket functions.

  • Friday, October 13, 2017
  • by Osushi
  • Repository
  • 1 Watchers
  • 3 Stars
  • 145 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 6 % Grown

The README.md

SimpleSocket

Packagist, (*1)

Functions

  • Create socket client simply (Now support tcp only)
  • Able to write simple logic on closure after connection

Requirements

  • PHP >= 7.0.*

Usage

composer require osushi/simple-socket

Examples

See: https://github.com/Osushi/SimpleSocket/blob/master/sample/Connector.php, (*2)

$connector = new \SimpleSocket\Connector();
$connector->connectTcp('google.com', 80)->then(function ($conn) {
  $conn->write("GET / HTTP/1.1\r\n\Host: google.com\r\n\r\n");

  var_dump($conn->read());
  /*
  string(519) "HTTP/1.1 302 Found
  ....
  </BODY></HTML>"
  */

  $conn->close();
});

The Versions

13/10 2017

dev-master

9999999-dev https://github.com/Osushi/SimpleSocket

This library can create socket client simply. It is written by php native socket functions.

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

client tcp socket

13/10 2017

0.0.1

0.0.1.0 https://github.com/Osushi/SimpleSocket

This library can create socket client simply. It is written by php native socket functions.

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

client tcp socket