Article View: borland.public.cppbuilder.internet.socket
Article #2334Re: Multiple serversockets in a single executable?
From: Arska
Date: Thu, 04 May 2006 10:01
Date: Thu, 04 May 2006 10:01
56 lines
2386 bytes
2386 bytes
Now it works. I suspect, the error was a stupid misunderstanding.
void __ fastcall TForm1:: ServerSocketCliedRead( TObject *TSender,
TCustomWinSocket *Socket)
{
AnsiString buf;
...
buf = Socket->ReceiveText();
Socket->SendText(" blaa blaa")
}
instead of
void __ fastcall TForm1:: ServerSocketCliedRead( TObject *TSender,
TCustomWinSocket *Socket)
{
AnsiString buf;
...
if(ServerSocket->Socket->Connections[X]->SocketHandle ==
User[n].SocketHandle()
buf = Socket->ReceiveText();
ServerSocket->Socket->Connections[X]->SendText(" blaa blaa")
}
Outside event handler ServerSocket->Socket works, but inside you have to use
Socket passed in a function call
Arska
"Arska" <joku@eiolemassa.fi> wrote in message
news:444f28ce@newsgroups.borland.com...
> Hello
>
> Is it possible to use two TServerSocket component in a single application?
I
> am writing a simple demonstration system, where several clients reports
> their status to the server (first client-server connection). The second
> client-server connection is an application where a client sends a request
to
> the server, which sends some data back. My server application is a single
> executable. I have used two TServerSocket components. The first works ok,
> but the second refuses to connect. It gives an event "On connecting", but
> don't establish connection. Suggestions how to solve this. I have tested
the
> system in a single computer and I use ports 8001 and 8002.
>
> Ari
>
>
Technical Details
Message-ID:
<4459d0fc$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<444f28ce@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: "Arska" <joku@eiolemassa.fi> Newsgroups: borland.public.cppbuilder.internet.socket References: <444f28ce@newsgroups.borland.com> Subject: Re: Multiple serversockets in a single executable? Date: Thu, 4 May 2006 13:01:29 +0300 Lines: 58 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 NNTP-Posting-Host: 130.188.112.160 Message-ID: <4459d0fc$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1146736892 130.188.112.160 (4 May 2006 03:01:32 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail