Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b7bf22d

Browse files
Add an example with a unix socket and timeout
See: #1663
1 parent 21c3ef9 commit b7bf22d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

README.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ $redis->connect('tls://127.0.0.1'); // enable transport level security, port 637
243243
$redis->connect('127.0.0.1', 6379, 2.5); // 2.5 sec timeout.
244244
$redis->connect('/tmp/redis.sock'); // unix domain socket.
245245
$redis->connect('127.0.0.1', 6379, 1, NULL, 100); // 1 sec timeout, 100ms delay between reconnection attempts.
246+
$redis->connect('/tmp/redis.sock', 0, 1.5, NULL, 0, 1.5); // Unix socket with 1.5s timeouts (connect and read)
246247

247248
/* With PhpRedis >= 5.3.0 you can specify authentication and stream information on connect */
248249
$redis->connect('127.0.0.1', 6379, 1, NULL, 0, 0, ['auth' => ['phpredis', 'phpredis']]);

0 commit comments

Comments
 (0)