🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Multiple serversockets in a single executable?

#2337
From: Remy Lebeau (TeamB)
Date: Thu, 04 May 2006 17:48
27 lines
1692 bytes
"Arska" <joku@eiolemassa.fi> wrote in message
news:4459f802@newsgroups.borland.com...

> This is how it should be:

No, it shouldn't.  You should not be using the Handle like that, and you
most certainly do not need to loop through the ActiveConnections looking for
the Handle while you are still inside the context of the event handler.  Use
the Socket that is provided to you, ie:

    void __ fastcall TForm1:: ServerSocketCliedRead( TObject *TSender,
TCustomWinSocket *Socket)
    {
        ...
        AnsiString buf = Socket->ReceiveText();
        ...
        Answer(Socket);
    }

    void Answer(TCustomWinSocket *Socket)
    {
        Socket->SendText("blaa blaa");
    }


Gambit
Technical Details
Message-ID: <445a3f30$3@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <444f28ce@newsgroups.borland.com> <4459d0fc$1@newsgroups.borland.com> <4459f802@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,3bf6510caf6f0f0e
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <444f28ce@newsgroups.borland.com> <4459d0fc$1@newsgroups.borland.com> <4459f802@newsgroups.borland.com>
Subject: Re: Multiple serversockets in a single executable?
Date: Thu, 4 May 2006 10:48:59 -0700
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <445a3f30$3@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1146765104 68.69.17.41 (4 May 2006 10:51:44 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail