Re: More detailed error codes from CFSocket?
Re: More detailed error codes from CFSocket?
- Subject: Re: More detailed error codes from CFSocket?
- From: Ryan McGann <email@hidden>
- Date: Sun, 18 May 2008 14:27:42 -0700
I'm implementing a TCP server based on the CocoaEcho sample code. This
code uses CFSocket to open the listener socket. Unfortunately the
error reporting is very limited basically "duh, I couldn't create
the socket" or "duh, I couldn't set the address". Is there any way to
get more detailed error codes, something like a POSIX errno value?
Unfortunately the CFNetwork sources aren't available anymore, but if
you look at the old sources, you'll see the function
_CFSocketLastError() simply calls thread_errno(). Since
_CFSocketLastError() is private, you might as well look at the value
of errno. Since CFSocket performs some work on a private thread, that
trick won't work if the error occured on a different thread, however
the only work performed on a seperate thread are read/write/accept. It
sounds like the problems you are encountering are with socket() and
bind() which are performed on the calling thread.
Ryan _______________________________________________
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