Article View: borland.public.cppbuilder.internet.socket
Article #3847TWinSocketStream->Write / Read questions
From: Guenter Stubbe
Date: Mon, 06 Jun 2005 16:12
Date: Mon, 06 Jun 2005 16:12
23 lines
1839 bytes
1839 bytes
Hi all, I have questions according to the usage of TWinSocketStream. If I call the Write method two or more times successively, not all data is transfered (in my application). If I code a Sleep(50) between them, the transfer works. Why? What is a good value for the Sleep? The Read method of TWinSocketStream can return a "-1"? I have read different answers in this newgroup: 23 Dec 2004, answer to Niyazi Unugur: "Read never returns -1. ..." 6 Apr 2005, answer to Paul: " ... You are not taking into account that Read can return -1 if an error occurs." In the german help there is a hint, that the WaitForData method should be called always, if a Read or Write method is called afterwards: In my code, the WaitForData only works for the Read method... What is a usual size for packets written or read via TWinSocketStream? I have no idea and need a starting point. Thanks in advance Guenter
Technical Details
Message-ID:
<42a475d3$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.google.com!news.maxwell.syr.edu!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11508e,4f2a9ddd9f75b2b,start X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Mon, 06 Jun 2005 18:12:15 +0200 From: Guenter Stubbe <no-spam@no.spam.com> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.socket Subject: TWinSocketStream->Write / Read questions Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 84.129.236.238 Message-ID: <42a475d3$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1118074323 84.129.236.238 (6 Jun 2005 09:12:03 -0700) Lines: 23 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.google.com!news.maxwell.syr.edu!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail