in reply to Re^4: Single server-multiple clients
in thread Single server-multiple clients

What parts of this still very unstructured stuff are fixed and what parts are your idea of an implementation?

Things get much, much easier once you reduce your protocol to a request-response structure. For example, clients could always initiate the communication by a request, be it "Here is an MD5 for my own file" or "Is there a file I should compute an MD5 for?".

I really recommend first thinking through the flow of messages through your whole system instead of thinking about threads and structs. Alternatively, learn first about network programming. Or learn about multiprocessing. But not all three in the same project and not at once.

Also, I'm not a native speaker of the English language, which makes it hard for me when you use txtspk like "u cud" where I expect to read "you could". If you would take more time to proof-read and expand your writing, that would make it more pleasant for me to read it.

Replies are listed 'Best First'.
Re^6: Single server-multiple clients
by hari9 (Sexton) on Jul 20, 2010 at 20:16 UTC

    Apologise for the slang

    fixed parts so far:

    1. Server and 2 Clients are made through socket program. ( The Code is something which I took from the net).

    2. To write/read files to/from disk/client ( using simple file operations).

    3. Verifying the MD5 of an x-client. ( By first,regex-ing the path of client and the drive, then perform verification(if md5_hex(path1/clientx/filex) Eq (md5_hex(pathx/diskx/filex)).

    parts to be fixed:

    1. How to make clients wait at the server, so that server can update their status on its table.
    2.If I use request/respond type... Will the proxy server be a function ( sub proxy()) or should it be connected to the server through sockets again.

    for clarification: The clients are on different machine.
    wherever I type
    %/> perl client.pl
    the client pings the server, when I type the same line on another machine( the same client-code I believe). Its the client2 that's pinging the server now.. so on..

    Thanks

      Have you considered making your protocol just HTTP?

      Also, have you considered that file I/O will be so slow that it will deliver data at the same speed whether one reading machine is reading from it or two? The two machines will each get (at best) half the speed.

        the prototype I'm using is 'tcp' since its within a group of systems in computer lab.

        Is there a efficient method to file i/o other than Open(fileh,">filename")


        I'm not quiet familiar about an alternate.