Solved

Limit accepts in Winsock

Posted on 2004-09-09
3
267 Views
Last Modified: 2013-11-13
How do i limit the number of connections that my socket wud accept to one in winsock ?
0
Comment
Question by:shubha_mohan
3 Comments
 
LVL 19

Accepted Solution

by:
drichards earned 250 total points
ID: 12018486
Don't call accept more than once.  You can control the number of connection requests that Winsock will queue up (backlog param on 'listen'), but if you want to limit the number of connections accepted, then it is up to your code.  Once you accept a connection, just don't re-issue the call to accept until the first connection is gone, or never if you want one and only one connection to be accepted rather than just one at a time.
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Regular Expression Calculator Tester 2 81
object oriented design (python) and documentation tools 2 71
Math Equation 23 105
Why use this lambda? 12 37
A short article about a problem I had getting the GPS LocationListener working.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

828 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