• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File transfer in networking.....

 
zniter goh
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone......
i have recently create a program that transmit and receive files
in a LAN(Local Area Network). The LAN enable me to transfer 100Mbps(MegaBits per seconds). but the tranferring speed was much slower than i drap & drop from the windows.....
at 1st i read using DataInputStream i only read and write 1 byte at a time only....but i try with 8 bytes the file may have error at the other side.....1 byte is much more safer....
can anyone tell me why.....???
and anyway to speed up.....
 
karl koch
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
ho fast was it ?
try create a small prog which writes a files, counts the bytes and takes the time. then you can calculate the speed.
the 100Mbps is a theoretically maximum ! youll never reach that in a real network enviroment due to other traffic, colision, retrys....
what does the network look like ? how many machines, routers, hubs.... is everithing 100Mbps capable ?are the card set to 100Mbps ?
so if you get close to the limit i think this is still good. but if you miss this limit by factors, then something is wrong.
bye, hope this gives you some ideas wher to look.
karl
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using BufferedInputStream and BufferedOutputStream? These will often improve efficiency considerably. Also it will help if you use the methods for reading/writing an array of bytes, rather than one byte at a time. It sounds like your attempt to write 8 bytes at a time had a bug in it - it's worth your time to figure out what the bug was. My guess is that if you're assuming that there should always be 8 bytes in each read, then you'll have problems at the end of a file if the total size is not a multiple of 8. You should be able to read/write a variable number of bytes - the read(byte[]) method tells you how many bytes it successfully read, so use this info. Good luck.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic