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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |