🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.networking
Article #1518

Re: TCP/IP 2.0 Socket Resources

#1518
From: Keith Bennett
Date: Wed, 06 Sep 1995 00:00
27 lines
2225 bytes
In article <3vo653$ahi@inforamp.net>,
Kevin Rosenthall <Kevin.Rosenthall@PoBox.Com> wrote:
>When you create a socket, the system (or TCP/IP stack) gives you a
>socket descriptor number, e.g. 26.  Now, if I close socket 26, and
>request a new socket, rather than getting 26 again, the system gives
>me socket 27.  It would appear that the system is not very good at
>recycling old sockets.

Kevin -

I don't think that this behavior demonstrates any lack of efficiency.  
I'm pretty sure that when a socket is closed, its resources (memory) are 
freed, even though the number isn't immediately reused.

Incrementing the number has an advantage over immediately reusing it:  If
you've passed the socket handle to another thread, etc., and the socket
has been closed, then a call with that socket handle will fail.  This is
as it should be.  Otherwise, the call would succeed even though it
referred to a socket different from the intended one. 

- Keith

-- 
--------------------------------------------------------------------------
Keith Bennett                             Bennett Business Solutions, Inc.
Silver Spring, MD USA                     OS/2 & DOS Software Development
kbennett@cpcug.org                        (301) 871-7696
Technical Details
Message-ID: <42kkg8$6fv@cpcug.org>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3vo653$ahi@inforamp.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1014da,9a65426cddd4a696
X-Google-Attributes: gid1014da,public
X-Google-Thread: 10121b,9a65426cddd4a696
X-Google-Attributes: gid10121b,public
X-Google-Thread: 106983,9a65426cddd4a696
X-Google-Attributes: gid106983,public
X-Google-Thread: 104dc3,9a65426cddd4a696
X-Google-Attributes: gid104dc3,public
X-Google-Thread: 100b63,9a65426cddd4a696
X-Google-Attributes: gid100b63,public
X-Google-Thread: 115d0d,9a65426cddd4a696
X-Google-Attributes: gid115d0d,public
From: kbennett@cpcug.org (Keith Bennett)
Subject: Re: TCP/IP 2.0 Socket Resources
Date: 1995/09/06
Message-ID: <42kkg8$6fv@cpcug.org>
X-Deja-AN: 109598482
references: <3vo653$ahi@inforamp.net>
organization: Express Access Online Communications, Greenbelt, MD USA
newsgroups: comp.os.os2.networking,comp.os.os2.networking.misc,comp.os.os2.networking.tcp-ip,comp.os.os2.programmer,comp.os.os2.programming,demon.ip.support.os2