🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8886

Re: Server and Client

#8886
From: Eelke Klein
Date: Fri, 27 Aug 2004 14:27
47 lines
2767 bytes
JD wrote:

> I've never worked with a client/server application before and
> even though I've been reading docs for the past 1 1/2 days,
> there's so much to weed through that I'd like someone to point
> me in the right direction (please).
> 
> Currently, the only requirements for the server are tracking
> users as they log on and off and sending and receiving messages
> to the clients. Also, the client could be on a a non-networked
> system.
What kind of connection will be available in that case?
> 
> What's the 'best' (perhaps fastest/easiest) way to meet minimum
> requirements?
> 
> In the future, some processing may be moved to the server which
> would involve client data manipulation and fetching and saving
> data to and from disk.
> 
> Same question: What's the best/fastest/easiest way?
> How would this solution impact on the choice of the first?
> 
> There has also been discussion of incorporating dialup and/or
> internet access in the future. Recommendations?
> 
> I also don't understand how the server gets started on the
> server. Would an install package take care of that or what?
> 
> ~ JD
> 
The easiest way to communicate between two apps is often to use sockets.
C++Builder has both a ServerSocket and a ClientSocket component for 
this. Data can be written to and read from a socket in a way similar to 
files. Read the help files for more info.

When the processing done by the server is simple and connection have a
very short lifetime you can get away with using a single thread and
handling all requests sequential.

When processing is more complex you will have to use a multithreaded
solution.

You will have to create some protocol for communication. For simple 
applications a text based line oriented protocol is often good enough.

Eelke
Technical Details
Message-ID: <412f44c4$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.zanker.org!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <412f395f$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,eb72ec3a40b04705
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Fri, 27 Aug 2004 16:27:43 +0200
From: Eelke Klein <e.klein@mplussoftware.nl>
User-Agent: Mozilla Thunderbird 0.7.2 (Windows/20040707)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Server and Client
References: <412f395f$1@newsgroups.borland.com>
In-Reply-To: <412f395f$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 81.58.1.162
Message-ID: <412f44c4$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1093616836 81.58.1.162 (27 Aug 2004 07:27:16 -0700)
Lines: 48
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.zanker.org!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail