Thank you for your help. I have a openssl ssl socket is shared by two threads, one and only thread should use this socket at any time. Then on top of tls_init(), do I have to put Mutex around my socket ??? Does tls_init() use to protect openssl internal strucure only ??
Thank You TD -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marek Marcola Sent: Saturday, November 04, 2006 11:15 To: openssl-users@openssl.org Subject: RE: Error accepting connections Hello, > Thank You very much. Suppose I store the method below in the > SslServerSocket.cc, then all I need to > Do is: > locking_function(int mode, int n, &SslServerSocket.cc, 8); > > id_function(void);// return Thread ID > > dyn_create_function(const &SslServerSocket.cc, 8); > > dyn_lock_function(struct CRYPTO_dynlock_value *l, > > &SslServerSocket.cc, 8); > > dyn_destroy_function(struct CRYPTO_dynlock_value *l, > > &SslServerSocket.cc, 8); > > Then call tls_init() before spin-off threads. Is it right way to do ?? All what you need is to run tls_init() at program startup and tls_destroy() at program end. This sets proper callbacks for OpenSSL and locking is performed internally by OpenSSL in multithreaded environment. Best regards, -- Marek Marcola <[EMAIL PROTECTED]> ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]