Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Non Locking, Non-Multithreaded Multiple Client TCP Server
Index -> Programming, C -> C Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jernst




PostPosted: Fri Apr 04, 2008 8:02 am   Post subject: Non Locking, Non-Multithreaded Multiple Client TCP Server

Heres some code I used for an assignment in a networks class. Maybe some one will have some use for it. It uses select() to switch between clients. It was a requirement that we could not fork a new thread for each client so this is another way to handle multiple clients. I have also attached the sample client program to make it easier to understand. The client requests a file and the server sends it back. From what I remember it only handles text files.


client.c
 Description:

Download
 Filename:  client.c
 Filesize:  2.39 KB
 Downloaded:  1878 Time(s)


server_select.c
 Description:

Download
 Filename:  server_select.c
 Filesize:  4.68 KB
 Downloaded:  2785 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
computer112




PostPosted: Wed Oct 15, 2008 10:10 am   Post subject: Re: Non Locking, Non-Multithreaded Multiple Client TCP Server

These files just some of the examples, Canada!
I saw some files were more complex than these! But anyway thanks for the topic!
Zeroth




PostPosted: Wed Oct 15, 2008 2:05 pm   Post subject: Re: Non Locking, Non-Multithreaded Multiple Client TCP Server

Pretty nice Jason. Very small, looks pretty decent.
coolgod




PostPosted: Sat Aug 07, 2010 2:18 am   Post subject: Re: Non Locking, Non-Multithreaded Multiple Client TCP Server

why non multi-threaded?
Display posts from previous:   
   Index -> Programming, C -> C Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: