🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: using TIdTCPServer

#3940
From: Simon Guertin
Date: Thu, 05 May 2005 18:19
47 lines
2577 bytes
I would have like to have all my processing code in another class. This 
class will takeover the client communication since it is not really the 
best place to take care of that in the event of TIdTCPServer OnExecute 
Event. By processing everything in the OnExecute Method, it will not be 
good programming practice I beleive. I think the way the Java class 
handles the client connexion is a good way of OO programming.

thanks for the answer

Simon


Remy Lebeau (TeamB) wrote:
> "Simon Guertin" <sguertin_AT@trellianetworks.com> wrote in message
> news:427a2a63$1@newsgroups.borland.com...
> 
> 
>>Hi, I am a long time Java user, so I think in Java a little bit. I
>>need to create a TCP server and I would like to know if using
>>the TIdTCPServer will be good for me or if I should implement
>>a server that looks like this (at the bottom of the email):
> 
> 
> TIdTCPServer already does exactly the same thing that your Java code is
> doing.  When activated, it runs a continous loop that accepts new client
> connections and spawns a thread for each one.
> 
> 
>>my question is, : I need to know where to put all my processing
>>of the connection.. other than in the TCPServerExecute() method
>>of the IndyServer.
> 
> 
> The OnExecute event *is* where you are supposed to place your processing
> code.
> 
> 
>>Should I re-write my own server..can I change the way the threads
>>are started?
> 
> 
> Why?  Do you have a problem with the way they are currently handled?
> 
> 
> Gambit
> 
> 
Technical Details
Message-ID: <427a6397@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!uio.no!uninett.no!news.net.uni-c.dk!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <427a2a63$1@newsgroups.borland.com> <427a508e@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,2b2bb416a158f43e
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 05 May 2005 14:19:11 -0400
From: Simon Guertin <sguertin_AT@trellianetworks.com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: using TIdTCPServer
References: <427a2a63$1@newsgroups.borland.com> <427a508e@newsgroups.borland.com>
In-Reply-To: <427a508e@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.71.74.98
Message-ID: <427a6397@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1115317143 67.71.74.98 (5 May 2005 11:19:03 -0700)
Lines: 47
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!uio.no!uninett.no!news.net.uni-c.dk!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail