Once the SSL socket is established all the necessary state for reading and writing is fully managed by the OpenSSL library. That is the Perl socket can be used between multiple threads, but only one thread should use the socket at one time (i.e. needs locking). Forking is different because in this case the SSL state gets duplicated and client and server try to manage their own state independently which will not work because then none of these will reflect the real state of the SSL connection.
Of course all this means that the Socket must be created before the threads are created. Creating a socket in one thread and then using it in another will not work since the Perl handle can not be shared.
In reply to Re^3: Can I/O operations on the same IO::Socket be executed in different threads?
by noxxi
in thread Can I/O operations on the same IO::Socket be executed in different threads?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |