// file: UDPInfo.java import java.net.*; import java.io.*; public class UDPInfo { public static void main( String[] args) throws SocketException { DatagramSocket s = new DatagramSocket(); PrintWriter p = new PrintWriter( System.out ); p.println( "Socket Information" ); p.println( "LocalPort = " + s.getLocalPort() ); p.println( "Port = " + s.getPort() ); p.println( "SoTimeout = " + s.getSoTimeout() ); p.println( "SendBufferSize = " + s.getSendBufferSize() ); p.println( "ReceiveBufferSize = " + s.getReceiveBufferSize() ); p.flush(); } }