Re: (Simple) problem with sockets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Mon, 23 Apr 2001, Glynn Clements wrote:

>
> lawson_whitney@juno.com wrote:
>
> > > I have two problems:
> > > 1) I'm using the file descriptor as an index into a fixed size array
> >
> > Don't.  You don't control the value of the fd,
>
> Are you quite sure about that? I'm quite sure that accept() exhibits
> the same behaviour as open(), dup() etc, i.e. it always returns the
> lowest-numbered unused descriptor. I'm not aware of any system call
> which allocates descriptors but doesn't behave this way.
>
I never meant to pick a fight with Glynn Clements :-).  In truth I was
overreacting to a problem I had a long time ago with a win31 app that
used filehandles to index a 20 element array when wine set about
unifying file handling.

I guess I have contributed my fair share of confusion to this thread.
>
> Quite the opposite; Unlike Unix, Windows *does* use arbitrary integer
> "handles" for this type of thing (one of the many reasons why WinSock
> only superficially resembles BSD sockets).
>
Not win31 :-).
>
> No; it just means that the /proc/<pid>/fd "symlinks" which refer to
> sockets aren't valid, in that "socket:[XXXX]" isn't a valid filename.
>
> --
> Glynn Clements <glynn.clements@virgin.net>
>
Shouldn't /proc/<pid>/fd/<n> be _gone_ after close(<n>)?

Maybe something else is wrong.

Lawson
---cut here


________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux