This discussion is archived
5 Replies Latest reply: Mar 14, 2012 8:50 AM by jtahlborn RSS

Architecture Client - Server

922613 Newbie
Currently Being Moderated
Hello everybody,

I need your help.

I'm starting to develop a new application client-server and I don't know exactly what to use to communicate with my client (1) and my server (4).

Here's exactly what I want to do :

- 1 client who initiates communication with the server, asking to download a folder.
- 1 client who initiates communication with the server, asking to get values.
- 1 client that starts the communication to send a file to the specified server.

RMI, socket ? Or other object ? I don't know how to implement the network communication.

Thanks for helping me.
  • 1. Re: Architecture Client - Server
    gimbal2 Guru
    Currently Being Moderated
    I don't know how to implement the network communication.
    So you don't know basic socket or networking theory?

    If not I would start by studying that. It may be too low level for your needs, but everything that has to do with networking derives from basic sockets so it is basically prerequisite knowledge if you want to do client/server programming.

    An observation: If
    - 1 client who initiates communication with the server, asking to get values.
    those 'values' are also file related, then what you are describing here is basically an FTP server + client.
  • 2. Re: Architecture Client - Server
    922613 Newbie
    Currently Being Moderated
    Hello gimbal2,

    Thank you for your answer !

    I have very basic knowledge about networking theory and I already program a small application with RMI (but only a simple application). But my problem with RMI was to propertly send a file on the server. And to download a large file, the transfer was too slow and sometimes files to big => error.

    My first idea was to used the FTP (a FTP server is already implemented on my server), but I don't only want to download file, but informations too.

    For example, my server application is running and I want to get back to my client some execution values (temperature, process time execution, etc.).

    And before to start downloading files, I want to execute a method to my server which generate the list of which file the client should download.

    In summary, there is the 2 sequences I would like to implement :

    -- 1. Download specific files ---
    1) Client => generateList() => Server
    2) Server generate the list
    3) Server callback => OK, list generated
    4) Client => downloadFileList() => Server
    5) Client => download all the file of the list => Server

    -- 2. Get informations ---
    1) Client application => getValues() => Server
    2) Server => sendTemperature() => Client
    3) Client display this value in live


    FTP for the file transfer, RMI to execute remote method, .... Should i implement a FTP with RMI ? And what about the RMIIO library ?

    Please help me to define the architecture...

    Thank you a lot for your help!!!
  • 3. Re: Architecture Client - Server
    gimbal2 Guru
    Currently Being Moderated
    Perhaps you don't need one technology; perhaps you need to apply two. You could use FTP to do file transfers (which requires only that you have the client code as you can simply use existing FTP server software), and use RMI to communicate with your home grown server application.

    Note that nowadays people tend to use the web for exposing functionality to clients. A SOAP or RESTful webservices can help you to do exactly what you are doing with RMI right now, plus it has that nice benefit that you can expose user interfaces through the web and such :)
  • 4. Re: Architecture Client - Server
    922613 Newbie
    Currently Being Moderated
    Thank you a lot for your answer.

    So, I will use both to communicate: for file transfer => FTP and for data transfer => RMI.
  • 5. Re: Architecture Client - Server
    jtahlborn Expert
    Currently Being Moderated
    user5070286 wrote:
    So, I will use both to communicate: for file transfer => FTP and for data transfer => RMI.
    as a side note (and as the primary RMIIO developer), rmiio is a great solution for sending data streams over rmi. however, if you already have an ftp server available, that generally makes more sense than using rmiio.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points