monday-factory/synchronous-socket-client

Super simple synchronous socket stream client

v1.0.7 2018-05-25 09:08 UTC

This package is auto-updated.

Last update: 2024-04-25 15:04:13 UTC


README

Super simple synchronous socket stream client

$options = [
	'connectionTimeout' => 30, // Default value
	'streamTimeout' => 30, // Default value
];

/**
 * @throws MondayFactory\SynchronousSocketClient\Exception\ConnectionException
 */
$connection = MondayFactory\SynchronousSocketClient\Connection::factory('tcp://my.super.server:12345', $options);

$response = $connection->sendMessage('{"method": "ping"}');

echo $response;

$connection->close();