Subject Re: [IB-Architect] Interbase connection limit and Support related Problems
Author Jan Mikkelsen
Jim Starkey <jas@...> wrote:
>Sockets are indeed handles, no question. But they don't work
>with read/write, only socket specific send/recv (this from personal
>experience). Unlike Unix fds, they are allocated sequentially.
>Also, on NT, the fd_set data structure is an array of handles
>which is searched, while on Unix it is a dense bit vector directly

Sockets handles work with ReadFile and WriteFile, the Win32 equivalents of
read(2) and write(2). You do not have to use a socket specific call with
socket handles.

The reason they don't work with read and write on Win32 is that read and
write are C runtime library functions, and there is a mapping layer for
handles so that the Unix style constants for stdin, stdout and stderr (0, 1,
2) work with read/write. Win32 does not guarantee the actual handle values
for standard streams.

Oh, and Unix typically allocates fds sequentially. Think dup(2) for
reassigning standard streams, not to mention bit vectors.

>But there are implementation details. The important point is that
>NT, unlike Solaris, does not have an API induced limit on the number
>of sockets supported. This is not to say that are not limits, but
>they are internal to NT and hence can be stretched by the whim of
>Brother Bill.

While Solaris may have a broken C runtime library, the operating system API
is not broken in the way you suggest. What is Interbase doing using C
stdio, anyway?

Jan Mikkelsen