?
Solved

How to make a reliable file transfer program with UDP?

Posted on 2012-03-23
5
Medium Priority
?
957 Views
Last Modified: 2012-03-24
Hey,

      I'm trying to make a reliable file transfer program with UDP in Java, I realize that this is redundant because TCP sockets are available in Java, but this is a class assignment.

I made a simple program that sends UDP packets, but files kinda get messed up sometimes since UDP isn't reliable, is there a simple way to send name-value pairs with UDP?  So I can rearrange the file according to the sequence number?

Appreciate any help on this!
0
Comment
Question by:errang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 37759741
read this trail - it is based on C, not on Java but the recommednations at the bottom
which would allow to do error checking are in fact indoenddent of the language:

http://www.linuxforums.org/forum/programming-scripting/124839-how-optimise-file-transfer-through-udp-sockets.html
0
 
LVL 47

Expert Comment

by:for_yan
ID: 37759743
0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 1000 total points
ID: 37759749
This is the plane form the link (the same I mentioned above)
http://www.linuxforums.org/forum/programming-scripting/124839-how-optimise-file-transfer-through-udp-sockets.html
 which I think gives
general scheme of making it reliable:


    Put a packet number in each packet.
    Add a checksum to each packet.
    Send an acknowledgement, and let it contain the packet number of the packet which has just been received.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 1000 total points
ID: 37760398
You need to do your own sequence numbering and checksumming. You can use java.util.zip.CRC32
0
 

Author Closing Comment

by:errang
ID: 37761921
Thanks!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question