From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,136c120daac2a1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 31 Jan 2006 00:59:45 -0600 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: tasksing and TCP sockets References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Tue, 31 Jan 2006 00:59:45 -0600 NNTP-Posting-Host: 67.169.16.3 X-Trace: sv3-hgvYHUzmmyLSyt1o4WgtdjK3lVzkAG3u3B7n5uFX1C3LP9C7NrLR6rvv2vLDfXtDLbrmfjmULRcum6T!D9DcsrLl0jWgFWmynJvB3iK7awxtCc5Jq1nXXEK/Bv1idUVNy9RFg+/59qpxkdyAJJG8HKRcjrk= X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:2722 Date: 2006-01-31T00:59:45-06:00 List-Id: >You should _not_ need delay statements. Redesign to be waiting on >socket completions. If the allowed response latency isn't terribly short (and it doesn't sound like it is here) there's nothing wrong with letting the system buffer up input while the reading task does a delay. Just use a blocking socket and poll to see if there's more input data available. Remember that "waiting on socket completions" in Windows means "polling the Windows message loop for a socket completion message". But it seems to me that if the object is to use TCP to emulate hardware, one should design for that hardware and do whatever is needed with UDP or TCP to make the best emulation. Is the intended hardware going to be polled or generate interrupts or Windows messages or what?