Errorsimulator

Errorsimulator - /* * @(#)Errorsimulator.java * * * @author...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/** * @(#)Errorsimulator.java * * * @author * @version 1.00 2009/8/2 */ import java.io.*; import java.net.*; import java.util.*; public class Errorsimulator implements Runnable { p DatagramPacket receivePacket,sendPacket; DatagramSocket listningSocket,sendingSocket; D String receivedOpcode ,changedOpcode; int serverPort, changedPort; int delay,clientPort; InetAddress clientAddress,serverAddress; // this array will contain the message from received packet byte request [] = new byte [512]; public void run(){ p //receives the packets try{ listningSocket = new DatagramSocket(68); }catch(SocketException e){ System.err.println(e); } try{ sendingSocket = new DatagramSocket(); }catch(SocketException e){ System.err.println(e); S } //packet created receivePacket = new DatagramPacket(request,request.length); r //receiveing socket try{ listningSocket.receive(receivePacket); }catch(IOException e){ System.out.println(e); S } //getting the address and port of the client clientAddress(receivePacket); c
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Errorsimulator - /* * @(#)Errorsimulator.java * * * @author...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online