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

x
?
Solved

Limit accepts in Winsock

Posted on 2004-09-09
3
Medium Priority
?
275 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 1000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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.
Simple Linear Regression

886 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