Solved

How to write TFTP UDP client application program

Posted on 2004-04-04
3
1,760 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
[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 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Chrome and Firefox Java 5 89
Java program running SQL query 5 68
Java array sort 10 63
Java import explained 4 49
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
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