Why do I get EPROTO from read()?
Submitted by: AdministratorEPROTO means that the protocol encountered an unrecoverable error for that endpoint. EPROTO is one of those catch-all error codes used by STREAMS-based drivers when a better code isn't available.
Not quite to do with EPROTO from read(), but I found out once that on some STREAMS-based implementations, EPROTO could be returned by accept() if the incoming connection was reset before the accept completes.
On some other implementations, accept seemed to be capable of blocking if this occured. This is important, since if select() said the listening socket was readable, then you would normally expect not to block in the accept() call. The fix is, of course, to set nonblocking mode on the listening socket if you are going to use select() on it.
Submitted by: Administrator
Not quite to do with EPROTO from read(), but I found out once that on some STREAMS-based implementations, EPROTO could be returned by accept() if the incoming connection was reset before the accept completes.
On some other implementations, accept seemed to be capable of blocking if this occured. This is important, since if select() said the listening socket was readable, then you would normally expect not to block in the accept() call. The fix is, of course, to set nonblocking mode on the listening socket if you are going to use select() on it.
Submitted by: Administrator
Read Online Unix Socket Programming Job Interview Questions And Answers
Top Unix Socket Programming Questions
☺ | How do Sockets Work? |
☺ | What is the difference between SO_REUSEADDR and SO_REUSEPORT? |
☺ | How would I put my socket in non-blocking mode? |
☺ | What exactly does SO_LINGER do? |
☺ | How can I be sure that UDP messages are received in order? |
Top Operating System (OS) Categories
☺ | RTOS Interview Questions. |
☺ | Windows 7 Interview Questions. |
☺ | MAC Operating System Interview Questions. |
☺ | Disk Operating System (DOS) Interview Questions. |
☺ | Shell Scripting Interview Questions. |