/** * Applets can't send data to an internet host other than the * host they came from. * * This applet should raise a security exception since it's * trying to send to www.sun.com * * @version JDK 1.1 * @author Marianne Mueller */ import java.awt.*; import java.net.*; import java.io.*; import java.lang.*; import java.applet.*; public class sendTest extends Applet { int port = 25; DatagramSocket s; DatagramPacket dp = null; InetAddress in = null; byte buf[] = new byte[10]; byte netaddr[]; public void init() { } public void paint(Graphics g) { try { s = new DatagramSocket(); // hostname "null" returns the default address for the local machine in = InetAddress.getByName("www.sun.com"); dp = new DatagramPacket(buf, 10, in, port); for (int i=0; i