Getting "Illegal Seek" error after calling accept()

Posted by Bilthon on Stack Overflow See other posts from Stack Overflow or by Bilthon
Published on 2010-05-19T14:19:50Z Indexed on 2010/05/19 14:20 UTC
Read the original article Hit count: 332

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

© Stack Overflow or respective owner

Related posts about sockets

Related posts about socket-programming