Thread View: borland.public.cppbuilder.internet.socket
8 messages
8 total messages
Started by sam
Thu, 21 Dec 2006 17:10
TcpClient OnReceive not fired
Author: sam
Date: Thu, 21 Dec 2006 17:10
Date: Thu, 21 Dec 2006 17:10
10 lines
1304 bytes
1304 bytes
I have dropped a TcpClient component with my free Turbo C++. The Remoteport = 80 and RemoteHost ="www.google.fr", BlockMode is set to bmBlocking. I use a button to make the conection to the RemoteHost like this TcpClient1->Open(); The connection is effective because the event OnConnect is fired. The problem is that OnReceive is never receive data, why ?? Sam
Re: TcpClient OnReceive not fired
Author: Hans Galema
Date: Thu, 21 Dec 2006 17:31
Date: Thu, 21 Dec 2006 17:31
20 lines
1496 bytes
1496 bytes
sam wrote: > The connection is effective because the event OnConnect is fired. Ok. > The problem is that OnReceive is never receive data, why ?? So OnReceive is triggered ? And then there is no data? I suppose that OnReceive is not triggered in blocking mode. You have to start reading in order to receive something. And what do you think the web server is sending upon a connect? I'm not familiar with this component. I just compare with TClientSocket. Why did you choose for blocking mode? Hans.
Re: TcpClient OnReceive not fired
Author: sam
Date: Thu, 21 Dec 2006 17:47
Date: Thu, 21 Dec 2006 17:47
28 lines
1728 bytes
1728 bytes
> Why did you choose for blocking mode? I don't know. My google is to receive an Html file from a remote server. What is the way for that ? Sam "Hans Galema" <notused@notused.nl> a �crit dans le message de news: 458ac581@newsgroups.borland.com... > sam wrote: > >> The connection is effective because the event OnConnect is fired. > > Ok. > >> The problem is that OnReceive is never receive data, why ?? > > So OnReceive is triggered ? And then there is no data? > > I suppose that OnReceive is not triggered in blocking mode. > You have to start reading in order to receive something. > > And what do you think the web server is sending upon a connect? > > I'm not familiar with this component. I just compare with TClientSocket. > > Why did you choose for blocking mode? > > Hans.
Re: TcpClient OnReceive not fired
Author: Hans Galema
Date: Thu, 21 Dec 2006 18:49
Date: Thu, 21 Dec 2006 18:49
22 lines
1649 bytes
1649 bytes
sam wrote: > I don't know. > My google is to receive an Html file from a remote server. > What is the way for that ? What is your google? Seeing that you used port 80 you probably want to get a html file from a httpserver (a webserver). If you use TcpClient then you have to program the whole http protocol yourself. So it is much easier to take a html component who does that all for you. You could use TIdHttp for it. Examples how to do that you can find in this group or after searching in this group with http://www.google.nl/advanced_group_search?hl=en Hans.
Re: TcpClient OnReceive not fired
Author: sam
Date: Thu, 21 Dec 2006 20:43
Date: Thu, 21 Dec 2006 20:43
32 lines
2043 bytes
2043 bytes
> What is your google? Sorry, it was my goal not google. > You could use TIdHttp for it. Yes but this does not exists into Turbo C++ free version. So I have no many other approach for getting a html file from a web server. Sam "Hans Galema" <notused@notused.nl> a �crit dans le message de news: 458ad7d3$1@newsgroups.borland.com... > sam wrote: > >> I don't know. >> My google is to receive an Html file from a remote server. >> What is the way for that ? > > What is your google? > > Seeing that you used port 80 you probably want to get a > html file from a httpserver (a webserver). > > If you use TcpClient then you have to program the whole > http protocol yourself. So it is much easier to take a > html component who does that all for you. > > You could use TIdHttp for it. > > Examples how to do that you can find in this group or after > searching in this group with > http://www.google.nl/advanced_group_search?hl=en > > Hans.
Re: TcpClient OnReceive not fired
Author: Remy Lebeau (TeamB)
Date: Thu, 21 Dec 2006 22:24
Date: Thu, 21 Dec 2006 22:24
14 lines
1318 bytes
1318 bytes
"sam" <nospam@nospam.com> wrote in message news:458ac12a@newsgroups.borland.com... > The problem is that OnReceive is never receive data, why ?? It is not supposed to be. OnReceive is only triggered when ReceiveBuf() is actually called. TTcpClient is not event-driven like TClientSocket is. TTcpClient and TTcpServer are very poorly designed components. I strongly advise against using them at all. Gambit
Re: TcpClient OnReceive not fired
Author: Hans Galema
Date: Fri, 22 Dec 2006 00:09
Date: Fri, 22 Dec 2006 00:09
13 lines
1449 bytes
1449 bytes
sam wrote: >>You could use TIdHttp for it. > > Yes but this does not exists into Turbo C++ free version. Yes it is part of Indy 9.0.50 which is part of Turbo C++ Exporer. It is not on the toolpallette however. So at designtime you cannot drop it on a form. What you can do however is instanstiate an instance at runtime. Add the specific .pas files to your project. Hans.
Re: TcpClient OnReceive not fired
Author: sam
Date: Sat, 23 Dec 2006 15:20
Date: Sat, 23 Dec 2006 15:20
18 lines
1635 bytes
1635 bytes
Hans see my new message: IdHTTP error when instanstiate at runtime "Hans Galema" <notused@notused.nl> a �crit dans le message de news: 458b22b4$1@newsgroups.borland.com... > sam wrote: > >>>You could use TIdHttp for it. >> >> Yes but this does not exists into Turbo C++ free version. > > Yes it is part of Indy 9.0.50 which is part of Turbo C++ Exporer. > > It is not on the toolpallette however. So at designtime you > cannot drop it on a form. What you can do however is instanstiate > an instance at runtime. Add the specific .pas files to your project. > > Hans.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads