Web server need help

This is a discussion on Web server need help within the Networking/Device Communication forums, part of the General Programming Boards category; Hi i have a problem with my code, if anyone here can help.
ok i create a thread that executes ...

Web server need help

Hi i have a problem with my code, if anyone here can help.
ok i create a thread that executes a function that receives a browser request and put it in a buffer. I create another thread that read the request from the buffer and sends the correct answer.
The problem is that he never executes the function of read_answer, he passes that function and the prog terminates.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell

I don't think you understand the assignment correctly. As it stands, your receive thread will be created, and immediately after, your Read_answer thread will be created. Even if you didn't overflow the stack with that loop, you would still have the receive thread and Read_answer thread running at the same time! Before new_sockfd gets created in receive, you will be trying to write to it in Read_answer. Obviously this won't work at all.