🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #4154

Re: threadblocking server connection handling

#4154
From: Remy Lebeau (TeamB)
Date: Thu, 24 Mar 2005 21:17
25 lines
1990 bytes
"havl" <havl83@wp.pl> wrote in message
news:42432745$1@newsgroups.borland.com...

> there was the same problem when i closed client application using the
> x icon in top right corner of the window without disconnecting before
> (even when i placed Socket->Close() in OnDestroy,OnClose, OnCloseQuery)

Never use the OnDestroy event.  It causes illeal behavior under C++.

> and exception was thrown pointing this time to strm->Read
> command in ReadBuffer function :)

Then you are not managing your buffers themselves properly to begin with.
You did not show the code where they are being declared or accessed outside
of ClientExecute().

> and saying the same: "the network location is no loger available; code 64"

That has nothing to do with your buffers.  That is caused by accessing an
invalid socket, which can happen during a disconnect.  That is why I put the
reading/writing code inside exception blocks, to catch errors like that.


Gambit
Technical Details
Message-ID: <42432e1a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4242c0bb@newsgroups.borland.com> <4242c5a1$1@newsgroups.borland.com> <4242da71@newsgroups.borland.com> <42431221$1@newsgroups.borland.com> <42432745$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,541706e3e4df9e6e
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <4242c0bb@newsgroups.borland.com> <4242c5a1$1@newsgroups.borland.com> <4242da71@newsgroups.borland.com> <42431221$1@newsgroups.borland.com> <42432745$1@newsgroups.borland.com>
Subject: Re: threadblocking server connection handling
Date: Thu, 24 Mar 2005 13:17:20 -0800
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <42432e1a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1111698970 68.69.17.41 (24 Mar 2005 13:16:10 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail