🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Servers & Backup

#4256
From: Jonathan Benedicto
Date: Wed, 09 Mar 2005 21:11
49 lines
2305 bytes
Maybe I'm missing something, but if I understand what you want, how 
about this type of idea :

// Global bool TimeToBackup.
bool TimeToBackup;

// In OnClientConnect
if( TimeToBackup )
{
    Socket->SendText("ERR-Sorry, backup is currently being 
performed.");
    Socket->Disconnect();
}

// In OnClientDisconnect
if( TimeToBackup && Server->Socket->ActiveConnections == 0)
{
    // Do backup.
    TimeToBackup = false;
}

-- 
Jonathan

"Vladimir Stefanovic" <antivari@po.sbb.co.yu> wrote in message 
news:422f5694@newsgroups.borland.com...
>
> * I have a server (service app+serversocket)
>
> * The server is supposed to receive files from
> many clients,  and store it in some folder say:
> C:\DATA
>
> * I want to periodically make a backup (pure copy)
> of the C:\DATA folder to C:\BACKUP folder.
>
> * It's not of major importance that backup procedure
> starts exactly at specified time (I can wait for current
> connections to finish the procedure first)
>
> * I want to wait for connections to be finished first because
> I think I can receive some error like 'file is occupied'
> otherwise.
>
> * How can I wait for clients to finish the connections
> first, and still be in position to inform them via same port
> that backup procedure is in progress.
>
> How would you do that? 
Technical Details
Message-ID: <422f667b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <422f5694@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,1c128025d98be9a8
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Jonathan Benedicto" <incorrect@no.server>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <422f5694@newsgroups.borland.com>
Subject: Re: Servers & Backup
Date: Wed, 9 Mar 2005 16:11:25 -0500
Lines: 51
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 69.158.120.85
Message-ID: <422f667b@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1110402683 69.158.120.85 (9 Mar 2005 13:11:23 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail