Re: Multithreading problem

2006-10-31 Thread kalikali
This won't work for a variety of reasons. One is that an SSL_write may fail because of a negotiation in progress and being able to *read* data from the socket may allow the write to progress. Even in my dreams I didn't imagined that you have try to compile it. Of course it won't work!!!

RE: Multithreading problem

2006-10-31 Thread David Schwartz
Windows sends FD_WRITE event if writing is possible and previous invokation of 'send' has failed with WSAEWOULDBLOCK code (only this code, if it has failed from other reason, FD_WRITE will not be send and waiting for it will cause deadlock)... Let me try one more time: 1) The code

Re: Multithreading problem

2006-10-30 Thread kalikali
If OpenSSL is unable to perform an operation, that means it tried it and couldn't do it. If that operation was a write, then when it becomes possible, you will get a write event. If that operation wasn't a write, then who cares when a write becomes possible? Maybe I show it using

RE: Multithreading problem

2006-10-30 Thread David Schwartz
--- PSEUDO CODE bool WaitOnWrite = false; int res; // it associates FD_WRITE event with SockEvent object WSAEventSelect(sock,SockEvent,FD_WRITE); for (;;) { if (WaitOnWrite) WaitForMultipleObjects(SockEvent) else

RE: Multithreading problem

2006-10-29 Thread David Schwartz
Don't get me wrong, but: I have really appreciated you for time you have devoted to answer me, but unfortunately it seems like it's rather your desire to be guru for others (i don't want to say ignorance) then real desire to help me, is why you are doing this. (I really don't want be

RE: Multithreading problem

2006-10-28 Thread David Schwartz
I'm not checking socket's possibility to write, i'm just issuing SSL_write command till SSL_write will return SSL_ERROR_WANT_WRITE. Now, what? Retry the write when anything changes. That would include receiving an FD_WRITE event. On unix i can use 'select' with socket handle as input in

Re: Multithreading problem

2006-10-28 Thread kalikali
Don't get me wrong, but: I have really appreciated you for time you have devoted to answer me, but unfortunately it seems like it's rather your desire to be guru for others (i don't want to say ignorance) then real desire to help me, is why you are doing this. (I really don't want be malicious,

Re: Multithreading problem

2006-10-27 Thread kalikali
No. I don't like blocking sockets because it's very hard to get them right Experience, how EASY it could be done in nonblocking mode is what i'm currently correlating with your words. ... let's cut this this thread. I've droped idea of using third party components and now i'm writing

RE: Multithreading problem

2006-10-27 Thread David Schwartz
It works good (for unencrypted sockets of course) but unfortunately in another way then someone may think. 'select' statement returns immediately when desired condition is met - for example you are waiting for some data to arrive and this data arrives 'select' returns, if you will not

RE: RE: Multithreading problem

2006-10-23 Thread Dinh, Thao V CIV B32-Branch
, October 20, 2006 9:57 To: openssl-users@openssl.org Subject: Re: RE: Multithreading problem I am very, very new to openssl. There is a good example (Example 5-16, Network Security with Openssl book)) for using nonblocking openssl. It is easy to understand. It uses one thread to handle 2

Re: RE: Multithreading problem

2006-10-23 Thread Richard Conlan
I am somewhat confused. Network Security with OpenSSL states quite clearly that OpenSSL handles multithreading and blocking sockets fine as long as you give it proper callbacks to acquire locks as needed. If you go to the book's site and download the code examples ( http://www.opensslbook.com/) it

RE: RE: Multithreading problem

2006-10-23 Thread David Schwartz
Actually, it's extremely complicated. For example, what do you do if you call 'write' and it doesn't return in a reasonable amount of time? You cannot use 'select' with blocking sockets. If you do, and your 'write' blocks (say because only a few bytes could be written at that

RE: RE: Multithreading problem

2006-10-23 Thread David Schwartz
I am somewhat confused. Network Security with OpenSSL states quite clearly that OpenSSL handles multithreading and blocking sockets fine as long as you give it proper callbacks to acquire locks as needed. If you go to the book's site and download the code examples (

RE: Multithreading problem

2006-10-20 Thread Dinh, Thao V CIV B32-Branch
To: openssl-users@openssl.org Subject: RE: Multithreading problem This problem was raised on this mailing list many times, but the clear solution (in my opinion) was not given. From OpenSSL FAQ: ...an SSL connection may not concurrently be used by multiple threads... This means that I can't have 2

Re: RE: Multithreading problem

2006-10-20 Thread kalikali
First... sorry for trash in my post's subjects. I'm using www interface on my email provider site for sending emails and there is no option to change this. (I don't known if this is my mailbox or this mailing list server problem). Actually, it's extremely complicated. For example, what do

Re: RE: Multithreading problem

2006-10-20 Thread kalikali
I am very, very new to openssl. There is a good example (Example 5-16, Network Security with Openssl book)) for using nonblocking openssl. It is easy to understand. It uses one thread to handle 2 nonblocking socket. You may have to modify it to handle multithread. At least, you have example

RE: Multithreading problem

2006-10-19 Thread David Schwartz
This problem was raised on this mailing list many times, but the clear solution (in my opinion) was not given. From OpenSSL FAQ: ...an SSL connection may not concurrently be used by multiple threads... This means that I can't have 2 threads, one reading and one writing at the same time