View Single Post
Old Mar 2nd, 2008, 5:34 PM   #5
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Re: Simple BSD Sockets Problem

recv will return -1 on error, 0 upon disconnection, or otherwise the number of bytes read. You should probably use that for numbytes. This is from 'man recv'

So make sure to properly handle the return value.

I've only skimmed so that is likely not the only issue.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote