PHPackages                             yidas/socket - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. yidas/socket

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yidas/socket
============

PHP socket

0.1(2y ago)07MITPHP

Since Jan 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/yidas/php-socket)[ Packagist](https://packagist.org/packages/yidas/socket)[ Docs](https://github.com/yidas/php-socket)[ RSS](/packages/yidas-socket/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

***php*** Socket
================

[](#php-socket)

Modern PHP Socket class based on native infra (pure PHP, CI, Yii, Laravel support)

[![Latest Stable Version](https://camo.githubusercontent.com/9ade9872ff70b89d0e35b857a6317c829956b430bf2f3ee4554a65159807a7a0/68747470733a2f2f706f7365722e707567782e6f72672f79696461732f736f636b65742f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/yidas/socket)[![License](https://camo.githubusercontent.com/512794565d4dc13503e98e15ac9e1ff4f6eacc9972ebdbc457ed03c83340541c/68747470733a2f2f706f7365722e707567782e6f72672f79696461732f736f636b65742f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/yidas/socket)

DEMONSTRATION
-------------

[](#demonstration)

### Client

[](#client)

```
try {

    $socket = new \yidas\socket\Client([
        'protocol' => 'tcp',
        'host' => 'smtp.your.com',
        'port' => '25',
        // 'domain' => AF_INET,
    ]);

} catch (Exception $e) {

    die("Failed to connect: {$e->getMessage()} (Code: {$e->getCode()})");
}

echo $socket->read();
// ...
$socket->write('STARTTLS');
echo $socket->read();
$result = $socket->enableCrypto();
// ...

$socket->close();
```

Native function support:

```
$socket = new \yidas\socket\Client();

try {

  $socket->stream_socket_client('tcp://smtp.your.com:25', $errorCode, $errorMsg, 15);

} catch (Exception $e) {

    die("Failed to connect: {$e->getMessage()} (Code: {$e->getCode()})");
}

$socket->fread(1024);
// ...
$socket->fwrite('STARTTLS');
echo $socket->fread(1024);
$result = $socket->stream_socket_enable_crypto(true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT);
// ...

$socket->fclose();
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

859d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b30d2b2c0b53aef65fad4af56cd3c7912d3db2b612890c706fe79448717f6aba?d=identicon)[yidas](/maintainers/yidas)

---

Top Contributors

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

---

Tags

phpSocketsocket\_createsocket lib

### Embed Badge

![Health badge](/badges/yidas-socket/health.svg)

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

###  Alternatives

[zoon/rialto

Manage Node resources from PHP

12199.4k3](/packages/zoon-rialto)[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

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