🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: ServerSocket and Threads

#790
From: Brendan Melia
Date: Wed, 12 Sep 2007 10:57
29 lines
1639 bytes
Patryk B. wrote:
> Hello,
> 
> Im using ServerSocket and Threads (http://dn.codegear.com/article/26276).
> 
> I have problem with closing server application when some clients are 
> connected.
> On FormClose event i have code:
> 
> ServerSocet->Active=false;
> 
> And everythink is ok when any client isn't connected.
> When client is connected and im trying to close application it hang.
> I think that i should disconnect client/terminate active threads befor 
> close application?
> 
> Best regards,
> 
> Patryk B.


You need to close the server. This then ensures the relevant TCP/IP 
state packets are sent to any attached clients.

ServerSocket->Close();



Bren.
Technical Details
Message-ID: <46e7c63b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <op.tyjavhtkwzezly@dune.intranet>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,f2f18bf54164452d
X-Google-Attributes: gid11508e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 12 Sep 2007 11:57:48 +0100
From: Brendan Melia <bmelia@hiden.co.uk>
User-Agent: Thunderbird 1.5.0.13 (Windows/20070809)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: ServerSocket and Threads
References: <op.tyjavhtkwzezly@dune.intranet>
In-Reply-To: <op.tyjavhtkwzezly@dune.intranet>
Content-Type: text/plain; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 83.104.166.249
Message-ID: <46e7c63b@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1189594683 83.104.166.249 (12 Sep 2007 03:58:03 -0700)
Lines: 29
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail