Results 1 to 2 of 2
- 10-05-2008, 08:59 AM #1
Member
- Join Date
- Oct 2008
- Posts
- 1
- Rep Power
- 0
Datagram Client and Server, client timer question
hey,
i'm very new to networking in Java and I'm trying to implement
a datagram client and server. My problem atm is writing a timer for the
client in java so that if the server does not respond within a certain time period then the client's request is resent. Could someone please show me how i would do this :), i have looked at the Timer class but my experimentation with it failed.
This was my experiment, out of curiousity could u tell me why "hello" was
not printed out.
Thanx :)Java Code:import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Timer; public class Timers { public static void main(String[] args){ int delay = 1000; //milliseconds ActionListener taskPerformer = new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { System.out.println("hello"); } }; new Timer(delay, taskPerformer).start(); } }
- 10-05-2008, 03:12 PM #2
Similar Threads
-
Server not able to connect client
By Kapil Gupta in forum New To JavaReplies: 15Last Post: 07-22-2008, 04:09 AM -
how client know what kind of server
By lemur in forum NetworkingReplies: 3Last Post: 05-31-2008, 07:11 AM -
client/server palindrom
By Rgfirefly24 in forum New To JavaReplies: 0Last Post: 04-28-2008, 02:19 AM -
Identify Client in Socket Client Server Application
By masadjie in forum NetworkingReplies: 1Last Post: 12-20-2007, 09:18 AM -
Problems with client and server
By Albert in forum Advanced JavaReplies: 2Last Post: 07-02-2007, 06:07 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks