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.
Code:(void *) receive() {
Here i create the socket, make him accept a connection and put the request in a buffer. }
(void *) read_answer() {
Here i read the request and then send the answer.
}
main() {
pthread_t thread,thread1
pthread_create(&thread, NULL, (void *)&receive,NULL);
while(1){
pthread_create(&thread1, NULL,(void *)&read_answer,NULL);
}