PHPackages                             navarr/sockets - 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. navarr/sockets

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

navarr/sockets
==============

Sockets in PHP

v0.3.1(1y ago)5143023[2 issues](https://github.com/navarr/Sockets/issues)MITPHPPHP ^8CI passing

Since Oct 1Pushed 5mo ago9 watchersCompare

[ Source](https://github.com/navarr/Sockets)[ Packagist](https://packagist.org/packages/navarr/sockets)[ GitHub Sponsors](https://github.com/navarr)[ RSS](/packages/navarr-sockets/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (5)Used By (0)

Sockets
=======

[](#sockets)

[![Latest Stable Version](https://camo.githubusercontent.com/89b96a0d8f43c372f6a07e749bff5cb4c6a50b75e9c21f2132a5486133b430c0/687474703a2f2f706f7365722e707567782e6f72672f6e61766172722f536f636b6574732f76)](https://packagist.org/packages/navarr/Sockets)[![Total Downloads](https://camo.githubusercontent.com/7c5a437652b776671a07a79cbffb2d101b47fa9779310407c2295b7846876963/687474703a2f2f706f7365722e707567782e6f72672f6e61766172722f536f636b6574732f646f776e6c6f616473)](https://packagist.org/packages/navarr/Sockets)[![Latest Unstable Version](https://camo.githubusercontent.com/01a30bda9ef47e0875d086b4aca9323f7c6cb35c6886145fd92e8fae71c32201/687474703a2f2f706f7365722e707567782e6f72672f6e61766172722f536f636b6574732f762f756e737461626c65)](https://packagist.org/packages/navarr/Sockets)[![License](https://camo.githubusercontent.com/b4fc8366a4e46fe0d5a89a6a41edd9b48f15c26e73f6407eeaf8615c32184d8a/687474703a2f2f706f7365722e707567782e6f72672f6e61766172722f536f636b6574732f6c6963656e7365)](https://packagist.org/packages/navarr/Sockets)
[![Tests](https://github.com/navarr/Sockets/actions/workflows/commit.yml/badge.svg)](https://github.com/navarr/Sockets/actions/workflows/commit.yml/badge.svg)[![Code Coverage](https://camo.githubusercontent.com/c086c32c354fa314194525e7d486aef7983883b05557c283bdc19446a9fcd910/68747470733a2f2f636f6465636f762e696f2f67682f6e61766172722f536f636b6574732f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d43394474727a4d437244)](https://camo.githubusercontent.com/c086c32c354fa314194525e7d486aef7983883b05557c283bdc19446a9fcd910/68747470733a2f2f636f6465636f762e696f2f67682f6e61766172722f536f636b6574732f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d43394474727a4d437244)[![Mutation Score](https://camo.githubusercontent.com/fbbb4cdf66d06bea0fae3b458c2fbd18d60cc4239711db74becff4e284203c20/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532466e6176617272253246536f636b6574732532466d61696e)](https://dashboard.stryker-mutator.io/reports/github.com/navarr/Sockets/main)

Sockets is a PHP Library intent on making working with PHP Sockets easier, including the creation and management of a Socket Server.

Work in Progress
----------------

[](#work-in-progress)

The code is currently still a work in progress, with the Socket class itself not yet fully complete. There is a lot I still need to understand about how sockets work both in PHP and probably in C in order to make everything work amazingly.

Not everything is tested yet, and not everything works properly yet.

It is advised not to seriously use this until I create git tag 1.0.0. There will be breaking changes before then.

Usage of SocketServer
---------------------

[](#usage-of-socketserver)

Using SocketServer is supposed to be an easy and trivial task (and the class should be documented enough to understand what it's doing without me).

### Example of an ECHO Server

[](#example-of-an-echo-server)

```
