From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Edwards To: Gary Thomas Cc: ecos-discuss@sources.redhat.com Subject: Re: [ECOS] RedBoot gets() implimentation question Date: Fri, 19 Jan 2001 07:31:00 -0000 Message-id: <20010119093601.A10765@visi.com> References: <20010118161705.A10218@visi.com> X-SW-Source: 2001-01/msg00339.html On Thu, Jan 18, 2001 at 04:08:52PM -0700, Gary Thomas wrote: > > That means that network polling stops and TCP sockets (and > > associated timers) go dead between between the time the first > > character is received and the newline is received? [I don't > > think that's a problem, but it's something to keep in mind.] > > Correct. This was a design choice - avoid the overhead of polling > for potential new TCP connections (all that's really going on here) > once data starts coming in. You must be able to type a lot faster than me. ;) > > I'm also curious about the inner loop: > > > > mon_set_read_char_timeout(50); > > while (timeout > 0) { > > res = mon_read_char_with_timeout(&c); > > if (res) { > > // Got a character > > break; > > } > > timeout -= 50; > > } > > > > Would the following be equivalent? > > > > mon_set_read_char_timeout(timeout); > > res = mon_read_char_with_timeout(&c); > > Yes and no. Yes - the overall timeout would be the same. No since > we want to go back and check for new TCP connections as often as is > reasonable. I can't figure out where the check for TCP connections is done. Is mon_read_char_with_timeout() supposed to call __tcp_poll() in some way that I've broken? My tests with ping seem to verify that on my board TCP polling is done once every 250ms (the value of timeout) while waiting for the first character of a command line. -- Grant Edwards grante@visi.com