Check - return false; }else{ return true; } } public static...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/** * @(#)Check.java * */ import java.io.*; import java.net.*; import java.lang.*; import java.util.*; i public class Check { p public static boolean validatePort(DatagramPacket p, int port, InetAddress ip){ int clientPort=p.getPort(); InetAddress clientAddress=p.getAddress(); if (clientPort!=port || !clientAddress.equals(ip) ){
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: return false; }else{ return true; } } public static boolean validateServer(DatagramPacket p, InetAddress ip){ InetAddress serverAddress=p.getAddress(); if (!serverAddress.equals(ip) ){ return false; }else{ return true; } } }...
View Full Document

Ask a homework question - tutors are online