Hello, Marc!,following,I will trouble you with some questions

How do you do,Marc!
I want to write some cods to transfer files.Some days ago,I discoverd ICE.But, It isn't easy,because all documents are in English, I am in chinese,And I did not used ice ago.
Yet , it is very peremptorily.Marc,can you give me a demo about transfering files via ICE.I am very sorry to trouble you!

Thanks!

[email protected]

Comments

  • michimichi Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-)Member ✭✭✭
    Have a look at the source code for IcePatch -- it shows how to do this.
    Also, have a look at http://www.zeroc.com/vbulletin/showthread.php?s=&threadid=292.

    Cheers,

    Michi.
  • tsinyuntsinyun Member
    I have already read the thread : "http://www.zeroc.com/vbulletin/show...=&threadid=292.";
    and the document about "ICEPath".
    I found they helped me with less.
  • tsinyuntsinyun Member
    And.I want to have some sample codes with VC7.01.
  • michimichi Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-)Member ✭✭✭
    Well, in outline, you can do something like this:

    sequence<byte> BinaryFile;

    interface FileStore {
    BinaryFile get(string filename);
    void put(string filename, BinaryFile file);
    };

    Then implement that in your server. You'll have to add appropriate exceptions, but that's about the gist of it. This works for files up to Ice.MessageSizeMax in length.

    Cheers,

    Michi.
  • tsinyuntsinyun Member
    Hello,Michi!Thank you!

    sequence<byte> BinaryFile;

    interface FileStore {
    BinaryFile get(string filename);
    void put(string filename, BinaryFile file);
    };


    I have written these code to hello.ice.
    After I ran "slice2cpp hello.ice",I got files:hello.h,hello.cpp.And I have written "helloI.h" with follow:

    #ifndef HELLO_I_H
    #define HELLO_I_H

    #include <Hello.h>

    class HelloI : public Hello
    {
    public:

    virtual ::BinaryFile get(const ::std::string&, const ::Ice::Context&);

    virtual void put(const ::std::string&, const ::BinaryFile&, const ::Ice::Context&);
    };

    #endif

    I think that I will implement the "get" function and "put" function in "HelloI.cpp".
    In them,I will implement read and wirte a file.what shall i pay attention to.
Sign In or Register to comment.