Skip to content

Commit 26f6780

Browse files
committed
improve fc3 example with timeouts
1 parent b3c48ea commit 26f6780

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

examples/fc3.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
$connection = BinaryStreamConnection::getBuilder()
1212
->setPort(5020)
1313
->setHost('127.0.0.1')
14+
->setConnectTimeoutSec(1.5) // timeout when establishing connection to the server
15+
->setWriteTimeoutSec(0.5) // timeout when writing/sending packet to the server
16+
->setReadTimeoutSec(0.3) // timeout when waiting response from server
1417
->setLogger(new EchoLogger())
1518
->build();
1619

0 commit comments

Comments
 (0)