Solved

How to write TFTP UDP client application program

Posted on 2004-04-04
3
1,737 Views
Last Modified: 2012-06-22
Hi
Could anybody tell me how to write simple TFTP client program using UDP socket programming.Whose function is to issue "Read" request to  the Server  to retrive file.
Thank you
 
0
Comment
Question by:Rafi-muqaddar
3 Comments
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 10751400
first thing to do in such case:
http://www.google.com/search?q=TFTP+UDP+client+java

i found one that looks good (the comments are in French):
http://monge.univ-mlv.fr/~roussel/vuibert/chapUDP/fr/umlv/ji/udp/
0
 
LVL 13

Accepted Solution

by:
Webstorm earned 500 total points
ID: 10751432
0
 

Author Comment

by:Rafi-muqaddar
ID: 10752358
Hi
thanx all of you for replying. Have a look on the following code:-
it is a simple UDP Echo client whose function is to echo back thorugh the server whatever typ by the user

import java.io.*;
import java.net.*;
public class UDPEchoClient
{
public static void main (String args[])
{
try
{
InetAddress host =InetAddress.getByName("localhost");
BufferedReader kbd = new BufferedReader(new InputStreamReader(System.in));
byte [] buf =new byte[1024];
DatagramSocket ds = new DatagramSocket();
DatagramPacket dp;
String line;
while((line=kbd.readLine())!=null)
{
dp =new DatagramPacket (line.getBytes(),line.length(), host,7);
ds.send(dp);
ds.receive(dp);
System.out.println(new String(dp.getData()));
}

}
catch(IOException e)
{
System.err.println(e);
}
}
}

My question is how to ammend this program inorder to work this program as a Tftp client to issue a "Read" rqeuest to the server to get the file.
Thanx
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now