SecureTransport and socket I/O
SecureTransport and socket I/O
- Subject: SecureTransport and socket I/O
- From: Larry Gerndt <email@hidden>
- Date: Sat, 27 Sep 2003 11:24:45 -0700
I posted a few weeks ago about some problems I was having where SSLRead()
was returning "sslProtocolErr". My socket was set for blocking mode, so in
attempting to fix this problem, I switched over to non-blocking mode and
copied Apples's SSLSample's SocketRead and SocketWrite code, and it worked
fine. Then I switched the socket back to blocking mode and left Apple's
SocketRead and SocketWrite code in place and it still worked. So I did some
investigation, and found out that even in blocking mode, the socket read
function can return without having read as much data as we requested,
meaning you have to read again to get the rest. Apple's sample SocketRead
handles this case and does the additional reads. By the way, on the first
read, it's not returning -1 and EAGAIN, it's returning a positive value,
indicating how many bytes it did indeed read, but that amount was not as
much as I requested, so it then reads again to get the rest, and this works
great.
My question: I thought in blocking mode, a "read" of a socket would not
return until as many bytes as requested are read. Was I wrong in this
assumption?
--
Larry Gerndt
AIM Handle: SonOfTheSonOfMan
Let the truth be told though the heavens fall -- James Garrison
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.