🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to know the number of the connection in using serversocket?

#3880
From: Hans Galema
Date: Thu, 12 May 2005 19:55
25 lines
1612 bytes
Didier wrote:

> (Socket.ReceiveBuf etc...);
> Now I 'd like to send an ack to the machine ;so I want to use 
> Socket->Connections[x]->SendText etc..


void __fastcall TForm1::ServerSocket1ClientRead(TObject *Sender,
       TCustomWinSocket *Socket)
{
  // Socket is the socket for the actual client.
  // So if you want to send to this specific client use

  ... first read all with Socket->ReceiveBuf()

  .. now send
   Socket->SendBuf ( ... );
}


If you loop through the Connectiones[] array from 0 to
ServerSocket->Socket->ActiveConnectios - 1 you will find that
one of them has the value Socket.

Hans.
Technical Details
Message-ID: <4283b574$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newsread.com!news-xfer.newsread.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4283b3c9@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,ceea40ef2e922ed2
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 12 May 2005 21:55:50 +0200
From: Hans Galema <notused@notused.nl>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: How to know the number of the connection in using serversocket?
References: <4283b3c9@newsgroups.borland.com>
In-Reply-To: <4283b3c9@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 129.125.201.248
Message-ID: <4283b574$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1115927924 129.125.201.248 (12 May 2005 12:58:44 -0700)
Lines: 25
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newsread.com!news-xfer.newsread.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail