• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 397
  • Last Modified:

one server, multi-client WinSock Programming?

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.
1 Solution
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.
  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.
jhjeonAuthor Commented:
that answer is hard to me and it is wide ,complex in contents.
I want  simple examples.
and sorry yonat, thanks to help me.
The Lifecycle Approach to Managing Security Policy

Managing application connectivity and security policies can be achieved more effectively when following a framework that automates repeatable processes and ensures that the right activities are performed in the right order.

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

-=- James.
Please check this location for a Sample Winsock program:

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,
jhjeonAuthor Commented:
thanks friends !!, have a nice day !
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Managing Security & Risk at the Speed of Business

Gartner Research VP, Neil McDonald & AlgoSec CTO, Prof. Avishai Wool, discuss the business-driven approach to automated security policy management, its benefits and how to align security policy management with business processes to address today's security challenges.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now