Skip to content

Commit be13326

Browse files
committed
improve documentation with example, fixes #162
1 parent 3d7b5e4 commit be13326

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/IO/Socket/SSL.pod

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,16 +1593,21 @@ by both peers.
15931593
A naive implementation would thus wait until it receives the
15941594
close notify message from the peer - which conflicts with the commonly expected
15951595
semantic that a close will not block. The default behavior is thus to only send
1596-
a close notify but not wait for the close notify of the peer. If this is
1597-
required C<SSL_fast_shutdown> need to be explicitly set to false.
1596+
a close notify but not wait for the close notify of the peer.
1597+
If it should instead wait for a close notify from the peer than
1598+
C<SSL_fast_shutdown> must be explicitly set to false:
1599+
1600+
$self->close(SSL_fast_shutdown => 0);
15981601

15991602
There are also cases where a SSL shutdown should not be done at all. This is
16001603
true for example when forking to let a child deal with the socket and closing
16011604
the socket in the parent process. A naive explicit C<close> or an implicit close
16021605
when destroying the socket in the parent would send a close notify to the peer
16031606
which would make the SSL socket in the client process unusable. In this case an
16041607
explicit C<close> with C<SSL_no_shutdown> set to true should be done in the
1605-
parent process.
1608+
parent process:
1609+
1610+
$self->close(SSL_no_shutdown => 1);
16061611

16071612
For more details and other arguments see C<stop_SSL> which gets called from
16081613
C<close> to shutdown the SSL state of the socket.

0 commit comments

Comments
 (0)