Logan Shaw wrote:

Palmman wrote:

I need to store a large chunk in memory, but it seems I am unable
to allocate more than 68k memory [It used to be 64k, right ?] to
a handle. I wanted to know if there is any workaround for this ?
I wanna send a large chunk of data through network in one go. I
really dont wanna split them into 68k chunks and send more than once.


Having said that, I'm not sure what network you're using, but most
networks themselves have a limitation on the size of a packet,
the MTU (maximum transmit unit).  It depends on the type of network
(on ethernet, it's commonly 1500 bytes; on gigabit ethernet with
"jumbo" frames, it can be around 10,000 bytes; on PPP over dialup
modem, it's often as small as 500 bytes; etc.).  So, even if you
could request that the network stack transmit 64K or more all at
once, it will still have to break it up into smaller pieces
before it sends it out.


To add something more:

you will have to do a loop in any case:

Imagine you have all your data in blocks a 32000 bytes and the first 2 blocks in aa startblock.

new_block_size = 32000;
send_block_size = 2 * new_block_size;

while (data_to_sent > 0)
{
     data_sent = NetLibSend(..., startptr, data_to_sent);
  /*
  * here you can easily discard the data sent and move in the new data
  */
    send_block_size -= data_sent;
    MemMove(startptr, startptr + data_sent, send_block_size);
    // send_block_size was 2 * new_block_size at the beginning
    if (send_block_size < new_block_size)
    {
        MemMove(startptr + send_block_size, new_block, new_block_size);
        send_block_size += new_block_size;
        new_block = get_next_block();
    }
    data_to_sent -= data_sent;
}

Just an outline of the idea.

Regards
Henk

--
-------------------------------------------------------------------------
  Henk Jonas                                            [EMAIL PROTECTED]
  Palm OS ® certified developer

  Please contact me, if you need an off-side contract worker.
-------------------------------------------------------------------------

--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to