Errorsimulator - )[email protected]@version 1.00...

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

View Full Document Right Arrow Icon
/** * @(#) * * * @author * @version 1.00 2009/8/2 */ import*; import*; 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.

This note was uploaded on 09/26/2009 for the course SCE Sysc3303 taught by Professor Marshall during the Summer '09 term at Carleton CA.

Page1 / 4

Errorsimulator - )[email protected]@version 1.00...

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