I'm trying to implement a server -client model where a master file need to be split into chunks and divided against peer nodes. The peer nodes share among themselves to get the whole file instead of getting it directly from the server. I'm running into issues when I run multiple peers instead of one. I get the following exception on each of the client thread trying to download files from server:
code for server to listen on a port and accepting connection from client:
As above each Client gets a ServerThread instance to send files to that client from server:
client can be initiated with this:
so each client starts a clientThread which initiates TCP connection with server and downloads its share of the chunk files:
I get the error at the line marked red. Can somebody help me out.
posted 4 years ago
it works absolutely fine if I just create one client thread. It fails when I try with more than one client.
Good night. Drive safely. Here's a tiny ad for the road: