Socket socket = new Socket(host, port); (socket.getOutputStream()).write((new Byte((byte)65)).byteValue());where port is an integer between 1 and 64000 and host is a String giving a host name (ex: gauss.ececs.uc.edu). If an exception is thrown the port is not active. Otherwise it is.
http://weather.noaa.gov/pub/data/observations/metar/decoded/XXXX.TXTwhere XXXX is the METAR code of the location you are interested in. For example, METAR for Lunken Airport is KLUK, for Cincinnati/Northern Kentucky airport its KCVG. This is really easy to do thanks to the URL class provided by Java. The following code gives the general idea:
String line; String url = "http://weather.noaa.gov/pub/da...ar/decoded"; String station = "KCVG"; URL weather = new URL(url+"/"+station+".TXT"); InputStream is = (InputStream)weather.getContent(); InputStreamReader isr = new InputStreamReader(is); BufferedReader bis = new BufferedReader(isr); while ((line = bis.readLine()) != null) text.append(line+"\n");Be sure to put this in a second, threaded class (that is, outside the applet class).