🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Simple e-mail server

#3390
From: Vladimir Stefanovic
Date: Tue, 27 Sep 2005 15:49
43 lines
2196 bytes
> A critical section should be locked for as short a time as
> possible, wrapping only the code that actually needs
> protecting.

Remy,

If the only job that my TServerSocket::OnGetThread
is to write a row (record) of data to some DB, can
that be considered fast (I expect up to 10 connections
at a time in the worst case)?

From my experience Insert()ing a row of data to a DB
is quite fast.

I ask that because of this:

You tought me how to receive data from server and send
some confirmation back directly from OnGetThread() to
client and that works fine for me.

But what if the operation in the OnGetThread() is not so
fast and I must have Critical Section because of accessing
the same files...

Do you think that I can because of fast escaping from
OnGetThread *only* store the *return* clients' addresses
and later use TClientSocket to send them confirmations
after processing?
Is that even possible because I have to pass the router?

To be more precise can I store ClientSocket in some list
and use it as a return address for confirmation?

void __fastcall TLanService::ServerSocketGetThread(TObject *Sender,
      TServerClientWinSocket *ClientSocket, < ---- STORE THIS
      TServerClientThread *&SocketThread)
{



-- 
Best regards,
Vladimir Stefanovic
Technical Details
Message-ID: <43396990@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4337dfe1$1@newsgroups.borland.com> <4338297e@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,97b4b095375844bd
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Vladimir Stefanovic" <antivari@po.sbb.co.yu>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <4337dfe1$1@newsgroups.borland.com> <4338297e@newsgroups.borland.com>
Subject: Re: Simple e-mail server
Date: Tue, 27 Sep 2005 17:49:18 +0200
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: 82.117.212.65
Message-ID: <43396990@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1127836048 82.117.212.65 (27 Sep 2005 08:47:28 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail