From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e8c6974546bc3f7f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.191.97 with SMTP id gx1mr3734083pbc.4.1353987403135; Mon, 26 Nov 2012 19:36:43 -0800 (PST) Path: 6ni13076pbd.1!nntp.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.posted.internetamerica!news.posted.internetamerica.POSTED!not-for-mail NNTP-Posting-Date: Mon, 26 Nov 2012 21:36:42 -0600 From: Robert Love Newsgroups: comp.lang.ada Date: Mon, 26 Nov 2012 21:37:43 -0600 Message-ID: <2012112621374336634-rblove@airmailnet> References: <2012112311175432190-rblove@airmailnet> <2012112315585358568-rblove@airmailnet> <17vopoh3g5mg4.jv11ioybge4k$.dlg@40tude.net> <2012112412270484092-rblove@airmailnet> <17btkxe7c0dse.1dndrk5qjz65x.dlg@40tude.net> MIME-Version: 1.0 Subject: Re: Sockets Example Sought User-Agent: Unison/2.1.9 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 98.194.39.33 X-Trace: sv3-ecP6dfEwP6wlg2w39aD936S2CgTEHjnwU+Rz0cB0vMucruO3B70/NWZnefXuqcmEY0QPYJbaduemi5+!Do0u+mSaYcN1VljEqjpTbGLw9fayeTSzjIOuYzNJ8nq5WCGqBc/y9PFLBn8dxmlWOG87fqwNdin6!BA== X-Complaints-To: abuse@airmail.net X-DMCA-Complaints-To: abuse@airmail.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2407 X-Received-Bytes: 2548 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Date: 2012-11-26T21:37:43-06:00 List-Id: On 2012-11-24 21:01:34 +0000, Dmitry A. Kazakov said: > On Sat, 24 Nov 2012 12:27:04 -0600, Robert Love wrote: > >> The statements about disposing of Data, what does Shutdown_Socket it >> do? It seems to end my task and never reach the following Close_Socket >> statement. If I leave it out, I see Close_Socket execute and the >> program seems to run fine. > > Shutdown_Socket does a graceful disconnection before closing the socket. In > particular it flushes/drops pending data. Under Windows it is important to > call it in order to be able to open another socket for the same port. > Otherwise it may take some considerable time after Close_Socket before the > port becomes free. The effect is that you may experience sporadic "port in > use" errors, e.g. when restarting the program. BTW, is there an official way to tell when the client closes the socket? When I'm reading data, I can tell. If I'm not reading data, I can call the Get_Peer(socket) function and catch an exception. It just seems there should be another way? Thanks for all the advice I've gotten so far. I'm 95% finished.