Archived

This forum has been archived. Please start a new discussion on GitHub.

Program implementation / File Transfer Questions (yes, i have read the faq :) )/ Ruby

I have read the faq about filetransfers but got a couple of questions more:

My program is going to play mp3 in the only machine that have speakers in my lan (i'll call it server). I'm going to use this interface to transfer a buffer of a mp3file from my clients:

module Q4MusicClient
{
sequence<byte> ByteSeq;

interface Mp3Client
{
nonmutating ByteSeq GetBuffer(int pos, int size);
}
}

Every clients know what to transfer, so in my "sever" application i call that method on every client until the buffer size is zero, and then i move to the next client.

The only two server methods for now are:

module Q4MusicServer
{
interface Mp3Server
{
// Add a client to ask for mp3
idempotent void RegisterClient(Q4MusicClient::Mp3Client* c);

// Remove the client from the queue
idempotent void UnregisterClient(Q4MusicClient::Mp3Client* c);
};
};

The two definitions are stored on different ice files, so in all i have four .cpp files and 4 .h files.

QUESTIONS: :)

1)Is the selection of the protocol going to afect the order in wich the packets come to the "server" ? That is: if i made two calls to Client::GetBuffer(...), is there any problem in using UDP for the conection?

I want to use UDP because i'm in a LAN and i think it will be much more effecient and less bandwidth hungry, i'm right? Or should i use TCP instead for this kind of applications?

2) I'm thinking of reading the mp3 files from the clients in chunks of 2048 bytes each call. Is it efficient enough? is there and optimal value i can choose to make better use of my class C 100mbps ethernet lan?

I'm very impressed with the quality of ICE, even whitout understanding all the implications of the system, being that i haven't had much experience in programming distributed system. One thing i can tell you: Having made research in a lot of other network toolkits and solutions, yours is the easiest to use and at the same time the most powerfull. And is very impressive too the feedback you can get from the direct developers of the product!!! So i wanted to thank you in in advance and congratulate you for your good job :)

One more question: how are you doing with the ruby language maping?

Thank you!

Comments

  • bernard
    bernard Jupiter, FL
    Hi Emmanuel,

    I recommend to use just plain TCP; you can't use UDP for invocations with return values. See "30.14 Datagram Invocations" in the manual.

    And as for your interface / message size, MP3 files are typically not that big, so why make it complicated? I'd use:
    nonmutating ByteSeq getSong();
    

    The default Ice max buffer size (1MB) should be plenty for typical MP3-encoded files.

    Cheers,
    Bernard
  • bernard
    bernard Jupiter, FL
    Ok, many MP3 files are actually larger than 1MB :). It depends on many factors, such as bit-rate, and overall length of the performance.

    If RAM usage is not a concern-- and file size remains reasonable, say less than 10 or 20 MB -- I'd still keep the simple API and set the Ice max memory size accordingly.

    Cheers,
    Bernard