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 yesterday

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 9% 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

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25025.5M80](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87930.4k113](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M84](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69122.6k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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