Solved

one server, multi-client WinSock  Programming?

Posted on 1998-03-25
6
362 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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 100 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

856 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