Okay, the code you posted doesn't look like it has any problems. Please post the smallest client and server programs you can create that produce this problem.
EDIT: Please also show the command you use to compile, any output from the compiler, and any instructions or data files we need to replicate the problem.