🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: i need ideas/comments with tclientsocket

#3143
From: Alfred
Date: Fri, 04 Nov 2005 10:22
30 lines
1867 bytes
>The Data is just a void* pointer, which a is 32-bit value.  An int is also a
>32-bit value.  If all you are storing is an int, then cast it back and forth
>directly:
>
>    int i = 12345;
>    Socket->Data = (void*) i;
>    i = (int) Socket->Data;

Thank you very much..
I need to use both TMemoryStream and a simple int. I think I need a struct for it ?

struct DataSocket
{
    int Proxy;
    TMemoryStream *MemoryStream;
};

onconnect :
   DataSocket *Data=new DataSocket;
   Socket->Data = Data;

and to use it ?
   Data->Proxy = 1;
   Data->MemoryStream = ....

It is correct ? ondisconnect only a Socket->Data=NULL or i have to free something ?

thank you very much for all help you all gived me
Alfred
Technical Details
Message-ID: <436b445c$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <43662baf$1@newsgroups.borland.com> <43667112$1@newsgroups.borland.com> <4366ccd3$1@newsgroups.borland.com> <4366d53d$1@newsgroups.borland.com> <4366deb1$1@newsgroups.borland.com> <43670f39@newsgroups.borland.com> <4367f9ea$1@newsgroups.borland.com> <4369a04d$1@newsgroups.borland.com> <436a4574$1@newsgroups.borland.com> <436a50c9@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,5c33b8c6a9ca7fdb
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Alfred" <alf@no.spam.not.valid.email>
Sender: "Alfred" <alf@no.spam.not.valid.email>
Reply-To: "Alfred" <alf@no.spam.not.valid.email>
Subject: Re: i need ideas/comments  with tclientsocket
Newsgroups: borland.public.cppbuilder.internet.socket
X-User-Info: 87.2.220.195     
References: <43662baf$1@newsgroups.borland.com> <43667112$1@newsgroups.borland.com> <4366ccd3$1@newsgroups.borland.com> <4366d53d$1@newsgroups.borland.com> <4366deb1$1@newsgroups.borland.com> <43670f39@newsgroups.borland.com> <4367f9ea$1@newsgroups.borland.com> <4369a04d$1@newsgroups.borland.com> <436a4574$1@newsgroups.borland.com> <436a50c9@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <436b445c$1@newsgroups.borland.com>
Date: 4 Nov 2005 03:22:04 -0700
X-Trace: newsgroups.borland.com 1131103324 207.105.83.66 (4 Nov 2005 03:22:04 -0700)
Lines: 30
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail