![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NFS write failed for server.....error 11 (RPC: Server can't decode arguments) | sap4ever | SUN Solaris | 3 | 05-08-2008 05:20 AM |
| Script runs fine on UNIX Server...Not through MSK Tool kit on Windows Server | madhunk | UNIX for Dummies Questions & Answers | 5 | 01-31-2008 10:30 AM |
| Axigen, A Fresh Approach for Mail Server Admins - Server Watch | iBot | UNIX and Linux RSS News | 0 | 07-12-2007 02:20 PM |
| Transfer file from local unix server to remote server | indira | Shell Programming and Scripting | 2 | 05-03-2007 03:35 AM |
| Dowloading a File from FTP Server to a local Server where User Id's are different | ranjith_taurean | Shell Programming and Scripting | 1 | 02-22-2007 04:47 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 Last edited by Gee; 12-10-2001 at 03:34 PM. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
What kind of server? What are you trying to accomplish? You mention 'GET' are you asking about a web (HTTP) server?
|
|
#3
|
|||
|
|||
|
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
|
||||
|
||||
|
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
|
|||
|
|||
|
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).
|
|||
| Google The UNIX and Linux Forums |