Thread: Illegal Seek weird error!

  1. #1
    Registered User Mortissus's Avatar
    Join Date
    Dec 2004
    Location
    Brazil, Porto Alegre
    Posts
    152

    Illegal Seek weird error!

    Hi everyone!

    I have a strange error in my application. After many recv calls, the next call receives less bytes than sent by the client. For example, the client sends 70 bytes and the server receives 40 bytes. It is important to notice that, after the first call to recv is made, perror prints "Illegal Seek". But even with this error, the server receive all the bytes sent by the client in the first calls. We print perror before the recv and, before the first call, perror prints "Sucess" (probaly to a select call).

    Thanks any insight!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    'x' bytes sent in one send call does not guarantee that 'x' bytes will be in any single recv call.

    Without seeing code, who knows what you've done
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User Mortissus's Avatar
    Join Date
    Dec 2004
    Location
    Brazil, Porto Alegre
    Posts
    152
    I understand. I have prepared the code to send in many chunks, as necessary. The Illegal Seek is still there, but I think it was my mistake to consider this as an error, since recv does not return -1, therefore not setting errno. I thought that could be poor kernel code, a system call inside recv that was not beeing handled. I was a fool to think that. Anyway! The code is now working, and the lesson is, even if the client can receive 500B in one chunk, does not means that the server can receive this amount in one chunk too.

    Thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 04:09 AM
  3. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  4. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  5. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 04:49 AM