• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Non-blocking SSLWrite problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non-blocking SSLWrite problems


  • Subject: Re: Non-blocking SSLWrite problems
  • From: Brian Webster <email@hidden>
  • Date: Wed, 12 Oct 2005 12:30:02 -0500

On Oct 12, 2005, at 12:08 PM, Rich Siegel wrote:

As far as I know, the SSLWriteProc should never return errSSLWouldBlock,
and in fact none of mine ever do. Your SSLWriteProc should push the data
at the socket, set *dataLength to the actual amount of data that was
actually transmitted, and only return an error if you want the whole
process to abort.
The way the docs are written implies that you should be able to return errSSLWouldBlock. From the discussion of the SSLWriteFunc callback:

"You may configure the underlying connection to operate in a nonblocking manner. In that case, a write operation may well return errSSLWouldBlock, indicating less data than requested was transferred and nothing is wrong except that the requested I/O hasn’t completed. This result is returned to the caller from the functions SSLRead, SSLWrite, or SSLHandshake."

Reading this, it really seems like you should be able to return errSSLWouldBlock from the callback, and then that error code is passed through as the result of SSLWrite.

The problem with waiting inside the write callback is that, due to SSLRead/SSLWrite not being thread safe (which I learned the hard way), I would not be able to perform any reads while I'm waiting inside SSLWrite to push data over the socket, which (at least in my program) can lead to a deadlock situation.

OpenSSL is starting to look better and better...

--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Non-blocking SSLWrite problems
      • From: Frederick Cheung <email@hidden>
References: 
 >Re: Non-blocking SSLWrite problems (From: Rich Siegel <email@hidden>)

  • Prev by Date: Re: Non-blocking SSLWrite problems
  • Next by Date: Re: Non-blocking SSLWrite problems
  • Previous by thread: Re: Non-blocking SSLWrite problems
  • Next by thread: Re: Non-blocking SSLWrite problems
  • Index(es):
    • Date
    • Thread