advice about a network app

Discussion in 'Java' started by cartercc@gmail.com, Mar 21, 2007.

  1. Guest

    Sorry, but Java isn't my language, so I'm showing my ignorance.

    My assignment is to create a number (35-40) client apps on a network
    segment that will communicate with a server that also resides on the
    segment. The clients accept queries from the server and reply to the
    server. Queries are like, 'How many cases have you processed this
    hour?, and replies can be an integer from 0 on up. The language in the
    spec is Java.

    The part that stumps me is building an application that will actually
    place a client on a node and start it. I'm thinking about something
    like this:

    public static void main(String[] args) {
    read configuration file that has the node name, IP addresse
    and port of the network nodes
    // each line looks like this: node1:192.168.100.1:9876
    String line = readline();
    ServerNode sn = new ServerNode(line);
    start(sn);
    line = readline();
    while (line =! null) {
    ClientNode cn = new ClientNode(line);
    deploy cn to appropriate machine depending on IP
    address;
    start(cn);
    line = readline();
    }
    }

    Unfortunately, I'm having trouble getting started. Any suggestions as
    to here to look? I don't have physical access to each machine to
    deploy each client. Each node is gauranteed to have a JVM.

    Thanks, CC.
    }
     
    , Mar 21, 2007
    #1
    1. Advertising

  2. Oliver Wong Guest

    <> wrote in message
    news:...
    > Sorry, but Java isn't my language, so I'm showing my ignorance.
    >
    > My assignment is to create a number (35-40) client apps on a network
    > segment that will communicate with a server that also resides on the
    > segment. The clients accept queries from the server and reply to the
    > server. Queries are like, 'How many cases have you processed this
    > hour?, and replies can be an integer from 0 on up. The language in the
    > spec is Java.


    In order to best tailor the answer for your situation, can you give
    some background information: This sounds like a fairly complicated
    project, so why would you try to implement it in a language you're not
    familiar with? Is the goal to "practice" or "learn" Java, or is your
    boss/client/teacher forcing you to use Java despite your where your skills
    lie? Where *do* your skills lie? Have you ever written a distributed
    application before? What programming languages are you familiar with? How
    familiar are you with the TCP/IP protocol? etc.

    >
    > The part that stumps me is building an application that will actually
    > place a client on a node and start it. I'm thinking about something
    > like this:
    >
    > public static void main(String[] args) {
    > read configuration file that has the node name, IP addresse
    > and port of the network nodes
    > // each line looks like this: node1:192.168.100.1:9876
    > String line = readline();
    > ServerNode sn = new ServerNode(line);
    > start(sn);
    > line = readline();
    > while (line =! null) {
    > ClientNode cn = new ClientNode(line);
    > deploy cn to appropriate machine depending on IP
    > address;
    > start(cn);
    > line = readline();
    > }
    > }
    >
    > Unfortunately, I'm having trouble getting started. Any suggestions as
    > to here to look? I don't have physical access to each machine to
    > deploy each client. Each node is gauranteed to have a JVM.


    If you're familiar with the TCP/IP protocol, you would probably be
    aware that in order to connect to a specific computer and exchange data
    with it, that computer needs to be listening on some port, and your
    connecting computer would need to specify the port when connecting.

    You would also probably be aware that there must be some software on
    these listening computers which will do something with the data they
    receive from listening to those ports.

    What that software is and what is does is critical to being able make
    any progress.

    - Oliver
     
    Oliver Wong, Mar 21, 2007
    #2
    1. Advertising

  3. Guest

    On Mar 21, 4:42 pm, "Oliver Wong" <> wrote:
    > In order to best tailor the answer for your situation, can you give
    > some background information: This sounds like a fairly complicated
    > project, so why would you try to implement it in a language you're not
    > familiar with? Is the goal to "practice" or "learn" Java, or is your
    > boss/client/teacher forcing you to use Java despite your where your skills
    > lie? Where *do* your skills lie? Have you ever written a distributed
    > application before? What programming languages are you familiar with? How
    > familiar are you with the TCP/IP protocol? etc.


    I work in an IT department of a large state university. I am a
    database guy, and my strength is Perl. I write a lot of file
    manipulation scripts, where I input one data file, process it, and
    output it in another form. It's all data related, and over the years
    we've amassed quite a bit of scripts, undocumented and frankly
    unmaintainable. I've written one largish Java app, participated in
    about six more, and am probably an advanced beginner/low intermediate
    in Java. I don't do network programming, at least not until now.

    The order of the day is, move to Java, stop using Perl, convert
    everything over. Obviously, we'll continue to do the one-off things in
    Perl, but we have several big apps that really do need to be in Java
    simply for the sake of maintaining them.


    > If you're familiar with the TCP/IP protocol, you would probably be
    > aware that in order to connect to a specific computer and exchange data
    > with it, that computer needs to be listening on some port, and your
    > connecting computer would need to specify the port when connecting.
    >


    Yeah. My background is as a web developer and server administrator, so
    I understand HTTP, TCP/IP, Apache, FTP, CGI, etc. This is where I
    learned Perl.

    > You would also probably be aware that there must be some software on
    > these listening computers which will do something with the data they
    > receive from listening to those ports.
    >
    > What that software is and what is does is critical to being able make
    > any progress.


    This may sound funny, but it's really a prototype to test the
    feasibility of a proposed system. I might not be the guy who should be
    doing this, but I'm the guy with the project, and I'm really 'the'
    programmer in my department. I don't know the eventual use, but I've
    got a real set of requirements -- build an application that will
    deploy an (arbitrary) number of clients that will self execute,
    listen, and reply to requests. Writing the server was easy, and using
    the UDP socket interface wasn't difficult. I'm just stuck on getting
    the clients going. I can install and start the client programs on
    several machines manually, but that doesn't meet the requirements.

    CC
     
    , Mar 21, 2007
    #3
  4. wrote:
    > On Mar 21, 4:42 pm, "Oliver Wong" <> wrote:
    >> In order to best tailor the answer for your situation, can you give
    >> some background information: This sounds like a fairly complicated
    >> project, so why would you try to implement it in a language you're not
    >> familiar with? Is the goal to "practice" or "learn" Java, or is your
    >> boss/client/teacher forcing you to use Java despite your where your skills
    >> lie? Where *do* your skills lie? Have you ever written a distributed
    >> application before? What programming languages are you familiar with? How
    >> familiar are you with the TCP/IP protocol? etc.

    >
    > I work in an IT department of a large state university. I am a
    > database guy, and my strength is Perl. I write a lot of file
    > manipulation scripts, where I input one data file, process it, and
    > output it in another form. It's all data related, and over the years
    > we've amassed quite a bit of scripts, undocumented and frankly
    > unmaintainable. I've written one largish Java app, participated in
    > about six more, and am probably an advanced beginner/low intermediate
    > in Java. I don't do network programming, at least not until now.
    >
    > The order of the day is, move to Java, stop using Perl, convert
    > everything over. Obviously, we'll continue to do the one-off things in
    > Perl, but we have several big apps that really do need to be in Java
    > simply for the sake of maintaining them.
    >
    >
    >> If you're familiar with the TCP/IP protocol, you would probably be
    >> aware that in order to connect to a specific computer and exchange data
    >> with it, that computer needs to be listening on some port, and your
    >> connecting computer would need to specify the port when connecting.
    >>

    >
    > Yeah. My background is as a web developer and server administrator, so
    > I understand HTTP, TCP/IP, Apache, FTP, CGI, etc. This is where I
    > learned Perl.
    >
    >> You would also probably be aware that there must be some software on
    >> these listening computers which will do something with the data they
    >> receive from listening to those ports.
    >>
    >> What that software is and what is does is critical to being able make
    >> any progress.

    >
    > This may sound funny, but it's really a prototype to test the
    > feasibility of a proposed system. I might not be the guy who should be
    > doing this, but I'm the guy with the project, and I'm really 'the'
    > programmer in my department. I don't know the eventual use, but I've
    > got a real set of requirements -- build an application that will
    > deploy an (arbitrary) number of clients that will self execute,
    > listen, and reply to requests. Writing the server was easy, and using
    > the UDP socket interface wasn't difficult. I'm just stuck on getting
    > the clients going. I can install and start the client programs on
    > several machines manually, but that doesn't meet the requirements.
    >


    What services are available on the client nodes? ftp? sftp? telnet? sshd?
     
    RedGrittyBrick, Mar 21, 2007
    #4
  5. Lew Guest

    Are you able to start apps on the client nodes via an administrative process
    or shell script, that is, not using Java? That would simplify things.

    Have all new client processes send to the central server and request
    instructions, then block until the server replies. The server would maintain a
    pool of clients who have "checked in", and send replies (only) to those to
    whom it must issue instructions. Then it does nothing with that client until
    it next sends its "I'm ready" message.

    That way the server never needs to know how many clients are out there until
    they are ready. It never needs to know where they are, or what ports are open.
    There is one server host (or cluster) with a well-known single open port. This
    is much simpler than managing a geometrically increasing web of clients.

    Keep the server "always" running (as a server should be). The clients report
    in whenever they are available. Multiple client instances can run on a single
    machine, which helps in testing.

    -- Lew
     
    Lew, Mar 21, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RJ
    Replies:
    1
    Views:
    439
    Scott Allen
    Aug 22, 2004
  2. Asun Friere
    Replies:
    1
    Views:
    512
    Paul Boddie
    Aug 27, 2003
  3. Peter Hansen
    Replies:
    23
    Views:
    892
    Anton Vredegoor
    Sep 5, 2003
  4. Gerrit Holl
    Replies:
    16
    Views:
    629
    Tom Plunket
    Aug 29, 2003
  5. Asun Friere
    Replies:
    0
    Views:
    487
    Asun Friere
    Aug 28, 2003
Loading...

Share This Page