Article View: borland.public.cppbuilder.internet.socket
Article #5548Re: Client Socket Connect Question
From: OKusmen
Date: Wed, 04 Aug 2004 08:21
Date: Wed, 04 Aug 2004 08:21
62 lines
2720 bytes
2720 bytes
void TTCPSendDataModule::OpenConnection()
{
SendSocket->Host = TCPSendTable->FieldValues["HostName"];
SendSocket->Port = TCPSendTable->FieldValues["PortNo"];
try{
SendSocket->Open();
connectionWaiting = true;
}catch(...){}
}
//--------------------------------------------------------------------------
-
void __fastcall TTCPSendDataModule::SendSocketRead(TObject *Sender,
TCustomWinSocket *Socket)
{
ReadIncomingPacket();
}
//--------------------------------------------------------------------------
-
void __fastcall TTCPSendDataModule::SendSocketConnect(TObject *Sender,
TCustomWinSocket *Socket)
{
SendPacketInOrder();
connectionWaiting = false;
}
//--------------------------------------------------------------------------
-
void __fastcall TTCPSendDataModule::SendSocketError(TObject *Sender,
TCustomWinSocket *Socket, TErrorEvent ErrorEvent, int &ErrorCode)
{
CloseSendSocket();
ErrorCode = 0;
connectionWaiting = false;
}
//--------------------------------------------------------------------------
-
bool TTCPSendDataModule::SendPacket(BYTE *buffer,int bufferLength)
{
bool result = false;
try
{
if( SendSocket->Active &&
SendSocket->Socket->SendBuf(buffer,bufferLength) == bufferLength ) // packet
is sent sucessfully
result = true;
}catch(...){}
return result;
}
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote in message
news:410fbe48$1@newsgroups.borland.com...
>
> "OKusmen" <okusmen@aselsan.com.tr> wrote in message
> news:410f4afe@newsgroups.borland.com...
>
> > In this scenario, I have to try a message two times. But,
> > I want to try once. What reason occurs this situation.
>
> Please show your actual code.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<41109cf1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<410f4afe@newsgroups.borland.com> <410fbe48$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,5e7c9fcee6f0909e X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "OKusmen" <okusmen@aselsan.com.tr> Newsgroups: borland.public.cppbuilder.internet.socket References: <410f4afe@newsgroups.borland.com> <410fbe48$1@newsgroups.borland.com> Subject: Re: Client Socket Connect Question Date: Wed, 4 Aug 2004 11:21:56 +0300 Lines: 64 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: 212.50.56.195 Message-ID: <41109cf1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1091607793 212.50.56.195 (4 Aug 2004 01:23:13 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail