🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to reconnect a client ?

#3584
From: Hans Galema
Date: Wed, 29 Jun 2005 06:33
61 lines
3214 bytes
Denis wrote:

> ... I was talking about one TClientSocket per process only to made
> the thinks simple.
> In the reality all process are server for all other process.

You are complicating things. Please do not speak about a process
as with c++builder one makes applications. You had already stated
that your application had one TServerSocket and one TClientSocket.
So it could act as a server and a client.

> The configuration is dynamic, but if I launch 3 process called A, B and C,
> the result of the connections are:
> 
> A ( server ) connect to B (client )
> A ( server ) connect to C(client )

Well already here I cannot follow you. A server does not connect
to a client. It is the other way round. Or did you mean 'is connected to' ?
A server can only listen and wait until a client makes a connection.
So the active player here is the client.

> B( server ) connect to A(client )
> B( server ) connect to C(client )
> 
> C( server ) connect to A(client )
> C( server ) connect to B (client )

In total this cannot be done with each application having only one
TServerSocket and one TClientsocket.

Cannot you rephrase the connections in this way:?

A ( TClientSocket ) connects to B (TServerSocket )
A ( TClientSocket ) connects to C (TServerSocket )

B ( TClientSocket ) connects to A (TServerSocket )
B ( TClientSocket ) connects to C (TServerSocket )

C ( TClientSocket ) connects to A (TServerSocket )
C ( TClientSocket ) connects to B (TServerSocket )

But for this each application needs two TClientSocket's.

> In this example A, B, and C have 1 TServerSocket and 3 TClientSocket.

3 ????

And where do you use the third for ? If you really use three than
give an example using TClientSocket1, TClientSocket2, TClientSocket3.

> So last question, how can I test if the connection is broken in the
> TClientSocket object ?
> Can I check the property Active ?

Probably. Or Socket->Connected.

But why do you want to check ? There are OnError and OnDisconnect
events which will tell you right away.

Hans.
Technical Details
Message-ID: <42c24180$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <42c15771@newsgroups.borland.com> <42c15d78@newsgroups.borland.com> <42c16e39$1@newsgroups.borland.com> <42c1706b@newsgroups.borland.com> <42c17750$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,274cba0e00c4db70
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 29 Jun 2005 08:33:03 +0200
From: Hans Galema <notused@notused.nl>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: How to reconnect a client ?
References: <42c15771@newsgroups.borland.com> <42c15d78@newsgroups.borland.com> <42c16e39$1@newsgroups.borland.com> <42c1706b@newsgroups.borland.com> <42c17750$1@newsgroups.borland.com>
In-Reply-To: <42c17750$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 129.125.201.248
Message-ID: <42c24180$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1120027008 129.125.201.248 (28 Jun 2005 23:36:48 -0700)
Lines: 61
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail