Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

one server, multi-client WinSock  Programming?

Posted on 1998-03-25
6
Medium Priority
?
390 Views
Last Modified: 2008-03-17
I am studying WinSock ..
I know one server, one client WinSock programming.
but I don't know  multi-client programming.
please HELP me !.
show me example source.
Thank you.
0
Comment
Question by:jhjeon
6 Comments
 
LVL 5

Expert Comment

by:yonat
ID: 1257827
Doug Schmidt and Steve Vinoski did a series of srticles about this on The C++ Report. Check out his page at http://www.cs.wustl.edu/~schmidt/report-doc.html - read the titles starting with "Comparing Alternative Programming Techniques for Multi-threaded Servers". Each article comes with actual source code, and examines a different concurrency modle for writing a multi-client server.
0
 
LVL 4

Expert Comment

by:jtwine100697
ID: 1257828
  Generally, when you reject someone's answer, you explain your reason(s) why...

   But anyway...  Multiple Client programming just means that you accept (and process) more than one socket connection at one time.  You can maintain all connected sockets in an array/list, and just iterate the array/list to process and data to/from the socket.  That is the simplest way to do it.

   Getting into multiple-threaded servers is a bit more complex, and you are going to HAVE to read a book on it.  Too damn much code to post!

-=- James.
0
 

Author Comment

by:jhjeon
ID: 1257829
that answer is hard to me and it is wide ,complex in contents.
I want  simple examples.
and sorry yonat, thanks to help me.
 
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 4

Expert Comment

by:jtwine100697
ID: 1257830
  Simple examples of what?  Of the array/list idea, or of Multithreaded servers (no "simple" examples there!)?

-=- James.
0
 
LVL 2

Accepted Solution

by:
seedy earned 300 total points
ID: 1257831
Please check this location for a Sample Winsock program:
   http://www.stardust.com/wsresource/winsock1/ws1code.html

This contains a Winsock1.1 sample code for a chat program
that accepts mulitple connections.  This is done thru MDI.
Each MDI child window handles one connection.  If you have
sufficient knowledge with windows programming you should be
able to modify this code to suit to your needs.
(Actually this sample code is server and client all rolled into
one program)
Hope this helps,
-Seedy-
0
 

Author Comment

by:jhjeon
ID: 1257832
thanks friends !!, have a nice day !
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question