Mail Archives: djgpp/1998/02/04/13:15:50
On Wed, 4 Feb 1998, Gisle Vanem wrote:
> I meant that handle X came from a home-brew socket() function that
> returns handles without knowing anything about DOS-handles or other
> handles.
That's a bug in the implementation of `socket'. See the message posted
by DJ Delorie. You need to allocate the handle using a special FSEXT
function provided for this. Usually, this is done by installing an FSEXT
handler for functions that open files. When that open handler is called,
it looks at the file name, and if the name is some special name supported
by the extension, it handles the call by calling __FSEXT_alloc_fd() and
immediately installs a handler for the handle returned by
__FSEXT_alloc_fd(). The latter makes sure the handle it returns is
unique and will not be reused by DOS for any other file unless you close
the socket first.
> Maybe I have to allocate the socket() handle using __FSEXT_alloc_fd()
> after all?
Definitely.
- Raw text -