Actually, no someone else wrote the server. Supposedly sending a blank line will terminate the parser, which is why I terminated the call with \n\n. I will have to dig into the server code and figure out what's going on now that I know I haven't don't anything wrong on the client.
And duh, yes I should use autoflush!