Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #67980

Re: Weird use of maps.

From "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Newsgroups comp.lang.c++
Subject Re: Weird use of maps.
Date 2019-08-28 14:54 -0700
Organization Aioe.org NNTP Server
Message-ID <qk6t62$mr2$1@gioia.aioe.org> (permalink)
References <qk5vm0$52n$1@dont-email.me> <f783922d-0264-4caa-a2b0-50a2580c5e1a@googlegroups.com>

Show all headers | View raw


On 8/28/2019 9:00 AM, Öö Tiib wrote:
> On Wednesday, 28 August 2019 16:30:51 UTC+3, James Kuyper  wrote:
> 
>> The context is a  message string that gets broken up into multiple parts
>> for transmission. Each part is transmitted along with a message ID, a
>> part number, and the total number of parts.
> 
> How can receiver realize that all parts have been received?


Think of sending a file using packets. Each one would have an offset 
into the file, where it physically belongs. So, the sender would send 
the file size to the receiver, get an ack to make sure it got it, retry 
if not. Once this is completed, the receiver would create a memory 
mapped file of the same size it received. The sender blasts packets each 
containing a file offset and payload. The receiver gets a packet, and 
writes its payload to the offset in the memory mapped file. The receiver 
can ask for missing offsets for any dropped, missing packets. Duplicate 
packets will simply overwrite existing offsets.

Here is the idea, I posted as SenderX:

https://groups.google.com/forum/#!original/alt.winsock.programming/-QXuP9174Gg/Qt1LB0tPt-8J

Afaict, it kind of sounds like Zmodem.






> Is the message part count known compile time and part numbers
> sequential and zero-based?
> Then std::array<std::optional<std::string>,Count> might be
> simplest.
> 
>> Can anyone suggest any good reason why
>> someone might use the more elaborate approach that was actually chosen?
> 
> It can be anything. For example initially ambitious requirements
> did change into simpler and so it was cut out from something
> way more overcomplicated.  The file change history from repo
> (and commit comments) may illuminate it a bit (if such exist).
> Results of developers with different skill levels differ by several
> orders of magnitude, but no one notices when that inefficiency
>   is in some non-critical part of program.
> 

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Weird use of maps. James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-08-28 09:30 -0400
  Re: Weird use of maps. Jens Kallup <jkallup@web.de> - 2019-08-28 16:22 +0200
    Re: Weird use of maps. James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-08-28 20:46 -0400
  Re: Weird use of maps. Öö Tiib <ootiib@hot.ee> - 2019-08-28 09:00 -0700
    Re: Weird use of maps. "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2019-08-28 14:54 -0700
    Re: Weird use of maps. James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-08-28 20:58 -0400
      Re: Weird use of maps. David Brown <david.brown@hesbynett.no> - 2019-08-29 10:24 +0200
        Re: Weird use of maps. James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-08-29 10:05 -0400
  Re: Weird use of maps. Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2019-08-28 19:19 +0100
    Re: Weird use of maps. James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-08-28 21:05 -0400
  Re: Weird use of maps. usenet@stegropa.de (Stefan Große Pawig) - 2019-08-28 20:22 +0200
    Re: Weird use of maps. James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-08-28 21:08 -0400
    Re: Weird use of maps. James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-08-28 21:16 -0400
      Re: Weird use of maps. usenet@stegropa.de (Stefan Große Pawig) - 2019-08-29 20:14 +0200
        Re: Weird use of maps. James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-08-29 20:14 -0400
          Re: Weird use of maps. David Brown <david.brown@hesbynett.no> - 2019-08-30 08:28 +0200
            Re: Weird use of maps. Öö Tiib <ootiib@hot.ee> - 2019-08-30 00:15 -0700
          Re: Weird use of maps. Manfred <noname@add.invalid> - 2019-09-13 17:49 +0200
            Re: Weird use of maps. James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-09-13 15:04 -0400
  Re: Weird use of maps. Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-08-28 19:33 +0000
    Re: Weird use of maps. James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-08-28 21:11 -0400

csiph-web