| View previous topic :: View next topic |
| Author |
Message |
Yoshi Guest
|
Posted: Sun Nov 16, 2003 11:57 am Post subject: Socketset size (FDSET size) |
|
|
Hi
I was wondering if there were any upper limit on how many sockets one might
send as FDSET in a select call to winsock.. I'm currently using a self
defined FDSET structure with an upper limit of 8K (8196). Since this is
pretty far from the predefined FD_SETSIZE at 64 sockets I was wondering
whether this may cause problems.
Note:
I know most windows versions can't handle that many sockets. Also don't
worry about my knowledge about how to manage such large socket sets with
reasonable performance in mind , though I would be interested if it turns
out it's faster to call select multiple times with smaller socketsets (Guess
if the code for rebuilding the set into the result is badly written this can
be slow...).
Regards Fredrik
|
|
| Back to top |
|
 |
Chad Z. Hower aka Kudzu Guest
|
Posted: Mon Nov 17, 2003 3:01 pm Post subject: Re: Socketset size (FDSET size) |
|
|
"Yoshi" <frely301 (AT) student (DOT) liu.se> wrote in
news:3fb76601 (AT) newsgroups (DOT) borland.com:
| Quote: | I was wondering if there were any upper limit on how many sockets one
might send as FDSET in a select call to winsock.. I'm currently using a
|
64.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Want to keep up to date with Indy?
Join Indy News - it free!
http://www.atozed.com/indy/news/
ELKNews - Get your free copy at http://www.atozedsoftware.com
|
|
| Back to top |
|
 |
Yoshi Guest
|
Posted: Mon Nov 17, 2003 5:01 pm Post subject: Re: Socketset size (FDSET size) |
|
|
Nah that's the predefined size of the socket array. (It's a simply
represented as a record in most languages.. ex. from winsock.pas below). The
server I'm working on seems to run just fine with a socket set of 1800+
sockets on XP/2k..
Regards Fredrik
<<>>
Winsock.pas:
const
FD_SETSIZE = 64;
type
TFDSet = record
fd_count: u_int;
fd_array: array[0..FD_SETSIZE-1] of TSocket;
end;
Note:
The select function takes the FDSet as a pointer parameter pointing on the
integer telling the size of the array starting at the +4 offset.
<<>>
"Chad Z. Hower aka Kudzu" <cpub (AT) hower (DOT) org> wrote
| Quote: | "Yoshi" <frely301 (AT) student (DOT) liu.se> wrote in
news:3fb76601 (AT) newsgroups (DOT) borland.com:
I was wondering if there were any upper limit on how many sockets one
might send as FDSET in a select call to winsock.. I'm currently using a
64.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Want to keep up to date with Indy?
Join Indy News - it free!
http://www.atozed.com/indy/news/
ELKNews - Get your free copy at http://www.atozedsoftware.com
|
|
|
| Back to top |
|
 |
Chad Z. Hower aka Kudzu Guest
|
Posted: Tue Nov 18, 2003 4:19 am Post subject: Re: Socketset size (FDSET size) |
|
|
"Yoshi" <frely301 (AT) student (DOT) liu.se> wrote in
news:3fb8fedc (AT) newsgroups (DOT) borland.com:
| Quote: | Nah that's the predefined size of the socket array. (It's a simply
represented as a record in most languages.. ex. from winsock.pas below).
The server I'm working on seems to run just fine with a socket set of
1800+ sockets on XP/2k..
|
The Win SDK lists it at 64 max. I've never seen it list exceptions for 2K, or
XP in this regard.
IIRC it will allow you to pass more, but ignores beyond 64.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Qualified help FAST with Indy Experts Support
from the experts themselves:
http://www.atozed.com/indy/experts/support.html
ELKNews - Get your free copy at http://www.atozedsoftware.com
|
|
| Back to top |
|
 |
Yoshi Guest
|
Posted: Tue Nov 18, 2003 11:36 am Post subject: Re: Socketset size (FDSET size) |
|
|
MSDN online also does list the max as 64 but also says as I said that it's
possible to redefine the max size of the set..
From MSDN:
(The default value of FD_SETSIZE is 64, which can be modified by defining
FD_SETSIZE to another value before including Winsock.h.)
"Chad Z. Hower aka Kudzu" <cpub (AT) hower (DOT) org> wrote
| Quote: | "Yoshi" <frely301 (AT) student (DOT) liu.se> wrote in
news:3fb8fedc (AT) newsgroups (DOT) borland.com:
Nah that's the predefined size of the socket array. (It's a simply
represented as a record in most languages.. ex. from winsock.pas below).
The server I'm working on seems to run just fine with a socket set of
1800+ sockets on XP/2k..
The Win SDK lists it at 64 max. I've never seen it list exceptions for 2K,
or
XP in this regard.
IIRC it will allow you to pass more, but ignores beyond 64.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Qualified help FAST with Indy Experts Support
from the experts themselves:
http://www.atozed.com/indy/experts/support.html
ELKNews - Get your free copy at http://www.atozedsoftware.com
|
|
|
| Back to top |
|
 |
Chad Z. Hower aka Kudzu Guest
|
Posted: Fri Nov 21, 2003 4:33 am Post subject: Re: Socketset size (FDSET size) |
|
|
"Yoshi" <frely301 (AT) student (DOT) liu.se> wrote in news:3fba0454$1
@newsgroups.borland.com:
| Quote: | MSDN online also does list the max as 64 but also says as I said that it's
possible to redefine the max size of the set..
|
Changing the size of the set does not mean that the OS will use a larger
size.
| Quote: | From MSDN:
(The default value of FD_SETSIZE is 64, which can be modified by defining
FD_SETSIZE to another value before including Winsock.h.)
|
I'd double check this. Even if it does work - Select is not designed for
usage in large numbers and even 64 can be quite a performnance hit. Better to
use Waits, or IOCP when in large numbers.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Want more Indy stuff? Try the Atozed Indy Portal at
http://www.atozedsoftware.com/
* More Free Demos
* Free Articles
* Extra Support
ELKNews - Get your free copy at http://www.atozedsoftware.com
|
|
| Back to top |
|
 |
|