Article View: borland.public.cppbuilder.nativeapi
Article #15359Re: shutdown (s, SD_SEND)
From: Tharun Pillay
Date: Mon, 07 Jul 2003 08:38
Date: Mon, 07 Jul 2003 08:38
48 lines
2936 bytes
2936 bytes
Ok. I apologise. I presented my thoughts incorrectly. I *know* that shutdown with SD_SEND does close the socket, rather it will notify when the data enqueued has been sent. Then when FD_CLOSE message is caught/recieved, the server should clear the buffer using recv until return is 0. Then use closesocket to close the socket and free the associated resources. Ok? Oh, and the problem is fixed - I'd paste a snippet, but it would probably leave more questions unanswered. We were testing the server performance on a windows 2000 pro machine. Then after encountering a serious leak (cpu and mem) in lsass, we discovered that SP3 wasn't installed. That sorted everything out. Another question, does how seriously does OutputDebugString hamper performance? We could test this ourselves, but just off the top of your head from your experience, could you drop me a tip. Thanks man, Tharun. "Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message news:3f061924$2@newsgroups.borland.com... > > "Tharun Pillay" <tharun@webmail.co.za> wrote in message > news:3f05bbc0@newsgroups.borland.com... > > > From my understanding, this instruction would tell winsock to > > close the socket once *all* the data enqueued in the socket > > buffer is sent. Right? > > I don't know where you got that understanding from. First off, shutdown() > does not ever close the socket at all. You need to use closesocket() for > that instead. Second, specifying SD_SEND simply tells WinSock to disallow > any further sends from that point on. The socket itself is still open and > valid, and can still receive incoming data. > > > The problem is that FD_CLOSE is triggered before all the > > data is sent - the first 8k are sent and then FD_CLOSE fires. > > Anyone know why???? > > Please show a more complete code snippet that shows exactly what you are > trying to do. > > > Gambit > >
Technical Details
Message-ID:
<3f09307f@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f05bbc0@newsgroups.borland.com> <3f061924$2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,7f7c8c74261a756b X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-07 01:39:29 PST From: "Tharun Pillay" <tharun@webmail.co.za> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f05bbc0@newsgroups.borland.com> <3f061924$2@newsgroups.borland.com> Subject: Re: shutdown (s, SD_SEND) Date: Mon, 7 Jul 2003 10:38:31 +0200 Lines: 50 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 196.15.202.200 Message-ID: <3f09307f@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1057566847 196.15.202.200 (7 Jul 2003 01:34:07 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail