C Board  

Go Back   C Board > General Programming Boards > Networking/Device Communication

Reply
 
LinkBack Thread Tools Display Modes
Old 04-12-2005, 12:33 PM   #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!
Mortissus is offline   Reply With Quote
Old 04-13-2005, 05:47 AM   #2
and the hat of Jobseeking
 
Salem's Avatar
 
Join Date: Aug 2001
Location: The edge of the known universe
Posts: 21,676
'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.

Salem is offline   Reply With Quote
Old 04-13-2005, 07:02 AM   #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!
Mortissus is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 01:13 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22