Getting "Illegal Seek" error after calling accept()
- by Bilthon
Well.. it's pretty much that, I seem to be getting a "Illegal Seek" error when checking my errno variable. The problem is that I have no idea of what that can mean.
I know sockets are treated like files in unix, but I can't see how can this be related to sockets. What I'm doing exactly is:
int sck = ::accept(m_socket, (struct sockaddr*)&client_address, (socklen_t*)&address_len);
Then I get sck = -1 and errno = ESPIPE
And the weird thing is that it happens randomly. I mean, sometimes the code works fine, and sometimes it just thows an exception. I'm working with threads so that's understandable. But I just would like to know what kind of behaviour makes the accept() call to set errno as ESPIPE so I could check the paramethers for instance.
Thanks
Nelson R. Pérez