Article View: borland.public.cppbuilder.internet.socket
Article #2804Re: TidTCPConnection read data delay
From: Bob Gonder
Date: Tue, 17 Jan 2006 17:28
Date: Tue, 17 Jan 2006 17:28
27 lines
2075 bytes
2075 bytes
supaul wrote: >while my server app and client app run in the same computer, the line in >codes mark with red will run normal, and speed is fast. But while server app >and client app run in two computers, client app will delay(the line mark >with red in codes), please tell me how to solve this problem? (There are no colors in the newsgroup, better to mark the lines with comments) See my message from 5/4/2005 50th71db9qmpnog2gldkeqvsfv112h3ano@4ax.com Subject: Re: sendto to same destination more times after eachother fails.? TCP buffers data so the data-to-packetheader ratio is sane. When sending a single integer, the packet is several times the size of the data, quite wastefull, so by default, TCP holds onto the data for a period of time, hoping more data will be sent. If you don't want to wait for the timeout, you need to tell TCP not to wait. Look into this WinSock API command, and parameters.. setsockopt(ClientOutSocket,IPPROTO_TCP,TCP_NODELAY,(char*)&t,sizeof(t));
Technical Details
Message-ID:
<ap9qs1pu7b6mf7cn9v9gejknfau59l1nmv@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43cc863b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,5b327d79ad23504f X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: TidTCPConnection read data delay Date: Tue, 17 Jan 2006 09:28:39 -0800 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <ap9qs1pu7b6mf7cn9v9gejknfau59l1nmv@4ax.com> References: <43cc863b@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 71.0.32.212 X-Trace: newsgroups.borland.com 1137518758 71.0.32.212 (17 Jan 2006 09:25:58 -0700) Lines: 30 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail