Article View: borland.public.cppbuilder.internet.socket
Article #784Multicast receiver program problem !!
From: Shiu-Huei-Huang
Date: Thu, 08 Nov 2007 03:43
Date: Thu, 08 Nov 2007 03:43
50 lines
2126 bytes
2126 bytes
I write a multicast receiver program !
But It doesnt work!
Who can tell me where does it go wrong ?
thanks
this is the source code using BCB 6 AND INDY 9 !
#include <vcl.h>
#pragma hdrstop
#include "RcvForm1Main.h"
//--------------------------------------------------------------------------
-
#pragma package(smart_init)
#pragma link "IdIPMCastBase"
#pragma link "IdIPMCastClient"
#pragma resource "*.dfm"
TRcvForm1 *RcvForm1;
//--------------------------------------------------------------------------
-
void __fastcall TRcvForm1::StartBtn1Click(TObject *Sender)
{
RcvLogMemo1->Clear();
IdIPMCastClient1->MulticastGroup="225.0.30.30";
IdIPMCastClient1->DefaultPort=3000;
IdIPMCastClient1->BufferSize=8192;
IdIPMCastClient1->Active=true;
}
//--------------------------------------------------------------------------
-
void __fastcall TRcvForm1::CloseBtn1Click(TObject *Sender)
{
IdIPMCastClient1->Active=false;
Application->Terminate();
}
//--------------------------------------------------------------------------
-
void __fastcall TRcvForm1::IdIPMCastClient1IPMCastRead(TObject *Sender,
TStream *AData, TIdSocketHandle *ABinding)
{
char RcvMsg[8192];
AData->ReadBuffer(RcvMsg,sizeof(RcvMsg));
RcvLogMemo1->Lines->Add(AnsiString(RcvMsg));
}
Technical Details
Message-ID:
<473285e6$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11508e,8906a097af4769c4,start X-Google-Attributes: gid11508e,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Shiu-Huei-Huang" <huei.huan@msa.hinet.net> Newsgroups: borland.public.cppbuilder.internet.socket Subject: Multicast receiver program problem !! Date: Thu, 8 Nov 2007 11:43:36 +0800 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 NNTP-Posting-Host: 122.146.18.3 Message-ID: <473285e6$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1194493414 122.146.18.3 (7 Nov 2007 19:43:34 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail