Article View: borland.public.cppbuilder.internet.socket
Article #3410TIdTCPClient/TIdTCPServer communication
From: Vladimir Stefanovic
Date: Fri, 30 Sep 2005 06:14
Date: Fri, 30 Sep 2005 06:14
43 lines
2218 bytes
2218 bytes
Hi, I want to use Indy to do the same thing that I knew with TClientSocket/TServerSocket: 1) TClientSocket (ctNonBlocking) sends buffer of data (possibly lots of data) to TServerSocket( stBlocking/ OnGetThread ) 2) TServerSocket receives data in a thread, in nagotiated protocol, for example: "buffer_length buffer" 3) TServerSocket sends back the confirmation to client that the operation was successful or not. * Which Indy components are the most suitable for that (I suppose TIdTCPClient/TIdTCPServer)? * Am I supposed to send data in peaces (buffer portins), then look how much data was actually sent, and continue from that place like I did with TClientSocket/TServerSocket? The same was with server. * I looked at methods of TIdTCPClient::TIdConnection and I saw many methods for sending data: Write, WriteBuffer, WriteCardinal, WriteFile, WriteHeader, WriteInteger, WriteLn, WriteSmallInt, WriteStream, WriteStrings. I remember that even in TClientSocket I had SendText() which was not reliabe because noone can guarantee that *all* the buffer will be sent at the same time. Is the same here? * Can someone show some working code? -- Best regards, Vladimir Stefanovic
Technical Details
Message-ID:
<433cd755@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!in.100proofnews.com!in.100proofnews.com!ecngs!feeder.ecngs.de!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11508e,6817d6944e9bb7ca X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Vladimir Stefanovic" <antivari@po.sbb.co.yu> Newsgroups: borland.public.cppbuilder.internet.socket Subject: TIdTCPClient/TIdTCPServer communication Date: Fri, 30 Sep 2005 08:14:35 +0200 Lines: 45 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 NNTP-Posting-Host: 82.117.212.65 Message-ID: <433cd755@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1128060757 82.117.212.65 (29 Sep 2005 23:12:37 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!in.100proofnews.com!in.100proofnews.com!ecngs!feeder.ecngs.de!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail