🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TServerClientWinSocket->Data Help Please

#214
From: DreamChaser
Date: Thu, 05 Jun 2008 18:04
36 lines
2026 bytes
Now for the stupid question:
How do I assign/read a string to the Socket->Data? Is it a double pointer?

(AnsiString**)Socket->Data = "DreamChaser";
AnsiString asName = (AnsiString**)Socket->Data;

I haven't done alot of pointer stuff, so I'm just asking. Thanks
DC

Remy Lebeau (TeamB) wrote:
> "DreamChaser" <NO-Spam@No-Span.net> wrote in message 
> news:48416d7a$1@newsgroups.borland.com...
> 
>> Has anybody gotten TServerClientWinSocket->Data to work with
>> storing an AnsiString? I got a new AnsiString() assigned to it during
>> the OnClientConnect event, and it seemed to work, but I am unsure
>> where/how to delete it.
> 
> Use the OnClientDisconnect event, ie:
> 
>     void __fastcall TForm1::ServerSocket1ClientConnect(TObject* Sender, 
> TCustomWinSocket* Socket)
>     {
>         Socket->Data = new AnsiString();
>     }
> 
>     void __fastcall TForm1::ServerSocket1ClientDisconnect(TObject* Sender, 
> TCustomWinSocket* Socket)
>     {
>         delete (AnsiString*) Socket->Data;
>     }
> 
> 
> Gambit 
> 
> 
Technical Details
Message-ID: <48482aae$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <48416d7a$1@newsgroups.borland.com> <48441ff3$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,67ea390c53ca6f1c
X-Google-Attributes: gid11508e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 05 Jun 2008 13:04:29 -0500
From: DreamChaser <NO-Spam@No-Span.net>
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: TServerClientWinSocket->Data Help Please
References: <48416d7a$1@newsgroups.borland.com> <48441ff3$1@newsgroups.borland.com>
In-Reply-To: <48441ff3$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 72.159.212.66
Message-ID: <48482aae$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1212689070 72.159.212.66 (5 Jun 2008 11:04:30 -0700)
Lines: 36
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail