Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-05-2005, 04:22 PM   #1
LQ Newbie
Registered: Oct 2005
Posts: 5

Rep: Reputation: 0
threads web server in c

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.

(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);
	pthread_create(&thread1, NULL,(void *)&read_answer,NULL);
Old 12-07-2005, 02:11 AM   #2
Wim Sturkenboom
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282 for a nice list of socket programs. One of them is echo-thread.c


examples, network, programming, threads

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant make web server run my local web page... Nik0s Linux - Newbie 22 10-08-2006 11:30 PM
can we configure a Linux server with mail server,file server and web server kumarx Linux - Newbie 5 09-09-2004 07:21 AM
adding more web servers to make web server farm linuxboy69 Linux - Networking 5 07-09-2004 10:50 AM
setting up password protected web forms on an apache web server AZDAVE Linux - Security 3 07-07-2004 01:03 PM
Can't access Linux web server web pages from LAN client jaydave Linux - Networking 4 03-16-2003 03:38 AM

All times are GMT -5. The time now is 06:43 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration