HELP (server?)


 
Thread Tools Search this Thread
Top Forums Programming HELP (server?)
# 1  
Old 12-09-2001
Question HELP (http server?)

Could anyone provide me with the source code for a simple multithreaded server in C that uses UNIX system calls, implementing only the GET command. Or point me to a location where I can view such source code?

any help will save my bacon!

Regards Gee Smilie

Last edited by Gee; 12-10-2001 at 06:34 PM..
# 2  
Old 12-10-2001
What kind of server? What are you trying to accomplish? You mention 'GET' are you asking about a web (HTTP) server?
# 3  
Old 12-10-2001
reply to PxT

Thanks for having a look at my post, sorry i forgot to mention that it is a very simple multithreaded http server I am trying to find the source code for.

All I want it to do is listen at port 8080.

When I point my browser to http://localhost:8080/ it will display my home directory.

I am very new to Unix and network programming and any help would be greatly appreciated.

Regards Gee.
# 4  
Old 12-10-2001
Why you wouldn't use Apache I don't know but...

If you want to "play" with an httpd server, try...

http://hoohoo.ncsa.uiuc.edu/

...you can download the source. It's small, fairly complete
but totally unsupported.
# 5  
Old 12-14-2001
Threads in unix are very simple and are created by the the system call pthread_create. The complete format of the system call is pthread_create(pthread_t *pid, const pthread_attr_t *attr, void *(*func) (void*), void *arg). The pid is the thread ID, the attr is the attributes, usually set to zero (NULL), the func is a pointer to the function that will execute first, and the arg is a pointer to the arguments of that function. Your programme must use first the socket() system call, to establish a socket, then call bind() to bind that socket to a sockaddr_in, then call listen() to make this socket a lstening socket and then call accept(). After accept you will call the pthread_create to handle the connection. It is a good idea to use the manual pages to get more information for the previously mentioned system calls (e.g type man pthread_create).
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Transfer file from server B to server C and running the script on server A

I have 3 servers A, B, C and server B is having some files in /u01/soa/ directory, these files i want to copy to server C, and i want to run the script from server A. Script(Server A) --> Files at Server B (Source server) --> Copy the files to Server C(Target Server). We dont have RSA key... (4 Replies)
Discussion started by: kiran_j
4 Replies

2. Shell Programming and Scripting

Shell script to copy a file from one server to anther server and execute the binary

Hi , Is there any script to copy a files (weblogic bianary + silent.xml ) from one server (linux) to another servers and then execute the copy file. We want to copy a file on multiple servers and run the installation. Thanks (1 Reply)
Discussion started by: Nawrajesh
1 Replies

3. Shell Programming and Scripting

Connect to server-1 from server-2 and get a file from server-1

I need to connect to a ftp server-1 from linux server-2 and copy/get a file from server-1 which follows a name pattern of FILENAME* (located on the root directory) and copy on a directory on server-2. Later, I have to use this file for ETL loading... For this I tried using as below /usr/bin/ftp... (8 Replies)
Discussion started by: dhruuv369
8 Replies

4. Shell Programming and Scripting

KSH fetching files from server A onto server B and putting on server C

Dear Friends, Sorry for this basic request. But I just started learning Ksh recently and still I am a newbie in this field. Q: I have files on one server and the date format is 20121001000009_224625.in which has year (yyyy) month (mm) and date (dd). I have these files on server A. The task... (8 Replies)
Discussion started by: BrownBob
8 Replies

5. UNIX for Dummies Questions & Answers

Access of Microsoft Team Foundation Server (TFS) repository from Unix Server

Hello, Some of our application team uses Microsoft Team Foundation server (TFS) reposity tool for their .NET projects , I would like to access it form Unix/Linux machine. Please let me know how can access the TFS from unix. Thanks (0 Replies)
Discussion started by: posix
0 Replies

6. Programming

Problem with Perl script after moving from a Windows/Apache Server to a UNIX server.

I have a Perl script that worked fine before moving it to justhost.com. It was on a Windows/Apache server. Just host is using UNIX. Other Perl scripts on other sites that were also moved work fine so I know Perl is functioning. The script is called cwrmail.pl and is located in my cgi-bin. When I... (9 Replies)
Discussion started by: BigBobbyB
9 Replies

7. Windows & DOS: Issues & Discussions

Office server => laptop =>client server ...a lengthy and laborious ftp procedure

Hi All, I need your expertise in finding a way to solve my problem.Please excuse if this is not the right forum to ask this question and guide me to the correct forum,if possible. I am a DBA and on a daily basis i have to ftp huge dump files from my company server to my laptop and then... (3 Replies)
Discussion started by: kunwar
3 Replies

8. Red Hat

when users ftp to server the timezone reflected is UTC but the server is set to TZ in localtime

Guys, Need your help coz my server runs in local time GMT +8, but when client use ftp and login, the resulting timestamp seen in each file is in UTC format. We need to set that the time should be the same as GMT +8 when in ftp session. I am using RHEL 5.3. root@]# ll total 1740... (2 Replies)
Discussion started by: shtobias
2 Replies

9. Shell Programming and Scripting

preserving the timestamp of a file when copied from remote server to local server using ftp

Hi, I need to copy few files from remote server to local server. I write a shell script to connect to the remote server using ftp and go to that path. Now i need to copy those files in the remote directory to my local server with the timestamp of all those files shouldnt be changed. ... (5 Replies)
Discussion started by: arunkumarmc
5 Replies
Login or Register to Ask a Question