🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TClientSocket OnRead event issues

#1935
From: Josh Arnold
Date: Thu, 14 Sep 2006 12:30
72 lines
2931 bytes
Gambit-

Here is my relevant code:

void Tfrm_Main::TCP_Init()
{

 //client socket communicates with embedded server socket
 client = new TClientSocket(frm_Main);
 client->Address = "192.168.78.139";

 client->Port = 1024;
 client->ClientType = ctNonBlocking;
 client->Open();
 client->OnRead = myClientRead;

}

//Send message
void __fastcall Tfrm_Main::Button4Click(TObject *Sender)
{

 client->Socket->SendText("hello\n");


}


//Event handler
void __fastcall Tfrm_Main::myClientRead(System::TObject *Sender,
TCustomWinSocket                 *Socket)
{
    Memo1->Text = Socket->ReceiveText();
   //receiveFlag = true;
}



Its farily simple I call the TCP_Init() function on a button click. Then
send a message on Button4Click event.

The server is set up to immediately reply back to the failing client app,
and as mentioned before, the server is responding.

There is a router in between the two but no firewall. The Chat app works
with the server device from the same machine that fails on the client app.

Thanks for the quick help,
-Josh

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:4508b143@newsgroups.borland.com...
>
> "Josh Arnold" <jdaudio02@hotmail.com> wrote in message
> news:4508aab1$1@newsgroups.borland.com...
>
> > I agree, but the old example chat program works using the
> > same TClientSocket component and nearly identical code.
>
> But, you are using it in two different IDE versions.  You also did not
> indicate whether the embedded server is behind a router or firewall.  It
> could be that the successful application is able to reach the server while
> the failing application is being blocked?  It could also just be that your
> reading code is wrong and you are causing OnRead notification messages to
be
> ignored.  It is really hard to say right now without seeing your actual
> code.
>
>
> Gambit
>
>
Technical Details
Message-ID: <450949ba$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4508a026@newsgroups.borland.com> <4508a3f3$2@newsgroups.borland.com> <4508aab1$1@newsgroups.borland.com> <4508b143@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,6164f1b08fcaf5c2
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Josh Arnold" <jarnold@atterotech.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <4508a026@newsgroups.borland.com> <4508a3f3$2@newsgroups.borland.com> <4508aab1$1@newsgroups.borland.com> <4508b143@newsgroups.borland.com>
Subject: Re: TClientSocket OnRead event issues
Date: Thu, 14 Sep 2006 08:30:23 -0400
Lines: 74
Organization: AtteroTech
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 70.89.2.105
Message-ID: <450949ba$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1158236602 70.89.2.105 (14 Sep 2006 05:23:22 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail