Re: recv() problem?

Steve Horsley <steve.horsley@xxxxxxxxx> wrote:
> David Schwartz wrote:
>> "Steve Horsley" <steve.horsley@xxxxxxxxx> wrote in message
>> news:dq0478$mbk$1@xxxxxxxxxxxxxxxxxxxxxxxx
>>> michal.shmueli@xxxxxxxxx wrote:
>>> Well, it looks like you signify the end of the server response by closing
>>> the connection,
>> Where did you get that from? It didn't look like that to me at all.
>> Nothing the OP said suggested this.

> From here:
> /**********************************
> ***********************************/
> if (send(new_fd, rdata1, MAX, 0) == -1){
> //error
> }
> close(new_fd);
> exit(0);

> I thought that either close() or exit() would do the trick.
> Am I so rusty that I'm missing something?

Nope - that should indeed cause the remote to get a read return of
zero, indicating close of connection and, by implication, end of
response. Of course, it isn't a "perfect" end of response indication
since one could get a read return of zero if the server application
crashed :)

rick jones
firebug n, the idiot who tosses a lit cigarette out his car window
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in but NOT BOTH...