Your code is too simple minded. It needs to read some bytes in and write those bytes out in a loop until there are no more bytes to be read.
Type: Posts; User: Norm
Your code is too simple minded. It needs to read some bytes in and write those bytes out in a loop until there are no more bytes to be read.
Add some printlns in the loop to print out the values of bytesRead and current to see what the code is doing. Compare to the value of filesize.
Also you need to read the API doc for the read()...
If it works properly, please explain the problem.
Your code has a hard coded filesize variable. Is the size correct for the file you are trying to send?
What is written to the output file? Is there a problem with it?
The code basically works for me when I use localhost.
Are you saying that Each PC is a server that other PCs can connect to directly. No master server.
How do the PCs get the IP addresses of the other PCs?
Are you going to write both a server and client code? There are dozens of sample programs from students on the forums.