This is some of my code, what I want to do is keep trying to read
information from my server until it gives me a response. But is
this a correct way of doing it? or will it cause me problems? Cos if the
server gives me the wrong message then i'm going to exit otherwise I'll
process the response. So after this code I process "buffer" to determine
my course of action.
Code:
//
write(nsFD,lookUp, strlen(lookUp));
//Iterate until a response is returned
while((numBytesRead = read(nsFD, buffer, 1024) < 0)) {
}
Cheers