Re: Orderly disconnecting using PowerPlant networking classes
Re: Orderly disconnecting using PowerPlant networking classes
- Subject: Re: Orderly disconnecting using PowerPlant networking classes
- From: Dave Rehring <email@hidden>
- Date: Fri, 29 Oct 2004 02:11:14 -0700
On 10/26/04 1:40 AM, Andy Cave at email@hidden wrote:
> Hi Dave.
>
> Is the client/server your code? Below it states that "you send a disconnect
> message and then sends orderly disconnect". If so then this is wrong - you
> should send just an orderly disconnect then 'wait' for the reply and close the
> endpoint. I think your code should go something like (on the receiving side):
>
> if (abort)
> endpoint->Disconnect();
> else {
> endpoint->SendDisconnect();
>
> do {
> char buffer[1024];
> int bytes = sizeof(buffer);
> try {
> // Read Data and ignore until get disconnect.
> UInt32 ioDataSize = bytes;
> Boolean outExpediated;
> endpoint->ReceiveData(buffer, ioDataSize, outExpediated, 1);
> }
> catch (LException exception)
> {
> if (exception.GetErrorCode() == Disconnect_Error ||
> exception.GetErrorCode() == OrderlyDisconnect_Error)
> break;
> }
> catch (...) {}
> LThread::Yield();
> } while (true);
> }
>
> endpoint->Unbind();
>
> delete endpoint;
>
> Andy.
>
> ----- Original Message -----
... My message deleted
Andy,
Thanks for the help. Your suggestion worked really well.
Later,
--
David Rehring Psychos do not explode when light hits
VP of Research and Development them, no matter how crazy they are...
Atimi Software, Inc.
www.atimi.com And totally insane guy!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden