Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to make a reliable file transfer program with UDP?

Posted on 2012-03-23
5
Medium Priority
?
985 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

598 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