i have to create a client server network. multiple clients multiple servers.
client will ask for different files and the servers will find that file and should give it back to the client.
i have to divide a txt file into different packets and keep it on different servers.
the help i need is :
how to create tcp packets of txt files? so that i can keep them at different servers..
Which part of the project do you need help on? The use of sockets for communication over a network? (If so, use Beej's guide as mentioned by CodePlug) The implementation and architecture for distributed computing? (If so, use a pre-packaged product like BOINC, boinc.berkeley.edu/ )
Mike
Last edited by MikeAThon; November 18th, 2008 at 12:53 PM.
Reason: to correct typo
this is the code i have for the Client Server Chat with Multi-Threading.. this is the SERVER code.
I have to make it change so that i can be able to DIVIDE A TXT FILE INTO PACKETS, THEN SEND THEM TO DIFFERENT SERVERS.. SO THAT WHEN A CLIENT ACCESSES THEM , THEN ALL THE PACKETS SHOULD COME TO HIM.. ITS JUST LIKE P2P FILE SHARING..BUT THE DIFFERENCT IS THAT THIS IS DISTRIBUTED COMPUTING..
HOPE YOU UNDERSTAND.. I NEED SERIOUS HELP.. YOU CAN ALSO CHANGE THE CODE AND SEND IT TO ME..
ONE MORE QUESTION:
CAN I GET THE CODE OF P2P FILE SHARING.. IN C++.. {It should work so that i can understand what actually happens "}
if(welcome_socket == INVALID_SOCKET)//same as this
{
cout<<"Socket could not be created.\n";
WSACleanup();
return;
}
string ipaddress;
int portno;
//cout<<"Enter your IP address: ";
ipaddress= "127.0.0.1";
cout<< "IP IS : "<<ipaddress<<endl;
// cin>>ipaddress;
//cout<<"Enter the port no.: ";//// mostly gave port number above 5000 ////
portno=6789;
cout<<"PORT : "<<portno<<endl;
SOCKADDR_IN sockaddress;
sockaddress.sin_addr.s_addr = inet_addr(ipaddress.c_str());// use at is it always
sockaddress.sin_port = htons(portno);
sockaddress.sin_family = AF_INET;
//listen for incoming connection requests on the welcome socket
listen(welcome_socket, 1);
//create a socket for communication by accepting any requests on welcome socket
//SOCKET comm_sock;
SOCKADDR_IN clientaddr;
int addresslen = sizeof(clientaddr);
// char*Buffer = new char[13];
Bookmarks