if threading

Server code:

1) Setup the socket and keep listening at a particular port and update its table of client addresses. 2) when packet is received from client ( the data from client), u need to decode 2 things- a) address of the client ( who's sending it, only then u ll knw who else to send it to, for verification) and b) wat is the type of packet ( it cud be the current client sending its md5 or it cud be the other clients who r verifying the current client is right) 3) if its "a", then it shud refer to its table and send a request to all other clients to see if this info is right. if packet type is "b" then it has to keep track of how many clients ve confirmed the data sent by the current client.

Client code:

1) client will have 2 threads- one thread will keep sending its md5 to server. one thread will listen to the server-and it ll c if the server is sending requests askin it to verify if the md5 sent by sum other client is right..

struct { int type; int data; }packet;

I know a little of C -threading and drew this plan for PERL,

but I'm not sure If this would work, because, client has to send the packet to server through socket , but I believe structs cant be sent thro sockets.. how to implement the communication of information b/w client(s) and server,hence keeping them on the same page. ( the only communication I cud think of is, establishing the socket and confirming the connection at server n client end.)

.

The server n client simulation and the entire communication of info between them is what i'm trying to build.

shared storage- It is just another machine's directory, eg C:/User/Disk

If threading doesnt work the way I'm expecting it to, I'm clueless what would be suitable for this problem, because server should always be listening ( only then will it be able to not block 2 client while its still communicating with the first one),

makes sense?

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.