PHPackages                             danjohnson95/php-socket-emitter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. danjohnson95/php-socket-emitter

ActiveLibrary[HTTP &amp; Networking](/categories/http)

danjohnson95/php-socket-emitter
===============================

Sends data over a TCP socket in an efficient manner

08PHP

Since Feb 14Pushed 9y agoCompare

[ Source](https://github.com/danjohnson95/PHP-Socket-Emitter)[ Packagist](https://packagist.org/packages/danjohnson95/php-socket-emitter)[ RSS](/packages/danjohnson95-php-socket-emitter/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP-Socket-Emitter
==================

[](#php-socket-emitter)

Sends data over a TCP socket in an efficient manner

Installation
------------

[](#installation)

```
$ composer require danjohnson95/php-socket-emitter

```

Usage
-----

[](#usage)

```
$host = "192.168.0.3"; // Where the TCP socket server is hosted
$port = 3010; // The port in which the TCP socket server is running on
$Socket = new Danj\PHPSocketEmitter\Socket($host, $port);

$Socket->send([
    'any'  => 'data',
    'you'  => 'want',
    'to'   => 'send',
    'goes' => 'here!'
]);

```

Why do I need this?
-------------------

[](#why-do-i-need-this)

Due to the asyncronous nature of PHP, you can't send lots of sockets over a short period of time.

This is because PHP can't tell if the last one has finished sending, and you can't send another TCP socket until the last one was received.

*PHP-Socket-Emitter* stores when the last socket was sent, and will delay execution of sending more until we can reasonably assume the last one was sent.

Therefore, you can do stuff like this:

```
foreach($BigObject as $Bit){
    $Socket->send($Array);
}

```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6871504?v=4)[Dan](/maintainers/danjohnson95)[@danjohnson95](https://github.com/danjohnson95)

---

Top Contributors

[![danjohnson95](https://avatars.githubusercontent.com/u/6871504?v=4)](https://github.com/danjohnson95 "danjohnson95 (4 commits)")

---

Tags

phpsockettcp-socket

### Embed Badge

![Health badge](/badges/danjohnson95-php-socket-emitter/health.svg)

```
[![Health](https://phpackages.com/badges/danjohnson95-php-socket-emitter/health.svg)](https://phpackages.com/packages/danjohnson95-php-socket-emitter)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
