comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Love <rblove@airmail.net>
Subject: Re: Sockets Example Sought
Date: Mon, 26 Nov 2012 21:37:43 -0600
Date: 2012-11-26T21:37:43-06:00	[thread overview]
Message-ID: <2012112621374336634-rblove@airmailnet> (raw)
In-Reply-To: 17btkxe7c0dse.1dndrk5qjz65x.dlg@40tude.net

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.




  reply	other threads:[~2012-11-27  3:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-23 17:17 Sockets Example Sought Robert Love
2012-11-23 18:32 ` Simon Wright
2012-11-23 21:58   ` Robert Love
2012-11-23 22:40     ` Dmitry A. Kazakov
2012-11-24 18:27       ` Robert Love
2012-11-24 21:01         ` Dmitry A. Kazakov
2012-11-27  3:37           ` Robert Love [this message]
2012-11-27  8:41             ` Dmitry A. Kazakov
2012-11-27 15:05             ` Mark Lorenzen
2012-11-23 23:08     ` Simon Wright
2012-11-28  4:43 ` anon
2012-11-30  5:04   ` Robert Love
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox