Skip to content

Commit f81ef45

Browse files
committed
Docs improvements
1 parent 454f215 commit f81ef45

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11

22
# SocketServer
33

4-
A library for create network applications with PHP.
4+
An useful library for creating asynchronous network applications with PHP.
55

66
>If you like this project gift us a ⭐.
77
8+
## Features.
9+
10+
- Asynchronous connections.
11+
- Multiple configuration options.
12+
- Event system to implement the application logic.
13+
- Logs support.
14+
815
## Installation.
916

1017
$ composer require thenlabs/socket-server

src/SocketServer.php

+12
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,18 @@ public function stop(): void
210210
}
211211
}
212212

213+
/**
214+
* Read input data from a client socket.
215+
*
216+
* With this method it's implements the strategy for read the input data from clients. Can be
217+
* seen that by default the sockets are read using the fgets function. In case which will be
218+
* necessary to implement a custom strategy, it's should override this method.
219+
*
220+
* Keep in mind that this method is the responsible to trigger the event.
221+
*
222+
* @param Connection $connection
223+
* @return void
224+
*/
213225
public function readDataFromConnection(Connection $connection): void
214226
{
215227
$data = fgets($connection->getSocket());

0 commit comments

Comments
 (0)