[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] Feature request: make socket errors public on a per soc
Re: [lwip-devel] Feature request: make socket errors public on a per socket basis
Mon, 21 Jan 2013 20:55:52 +0100
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/17.0 Thunderbird/17.0
the err member variable stored in struct lwip_sock should be accessible for
evaluation by applications.
It is: call getsockopt(s, SOL_SOCKET, SO_ERROR, ...) to get and clear it
at the same time.
The errno mechanism is useless because the error
code is not accessible on a per socket basis.
That doesn't make it useless. You can even override set_errno() to get a
I suggest adding the following to sockets.c:
int lwip_getsockerr(int socket)
// add some sanity checks here
Our socket API is meant to be an implementation of the standards. Being
like that, you should use the method described above.