Problem w/ sockets, fdopen, and blocking.
I am having a silly problem w/ sockets and fscanf right now. I'm writing a server which uses pthreads for its concurrency. When it gets a client it creates a new pthread to handle it. I then use fdopen to open the file descriptor returned from accept as a FILE. I then use setvbuf(fd, NULL, _IONBF, 0) to turn off buffering. When I run fscanf w/ %s I expect it to immediately return whenever something is sent, regardless if it has a new line or if the buffer is full or not. However, it just blocks until it gets a new line. read works fine, but I would prefer fscanf. Why is setvbuf not working?