problem with getInetAddress()

alice dubois alice.dubois at lemel.fr
Wed Nov 25 04:28:10 PST 1998


Hello,

First, tkanks for the patch about DataInputStream.java, it works very well 
now.
But before running "make derived-files" it's necessary to add "import 
java.awt.Font;" in kaffe/applet/AppletViewer.java and in java/lang/
Boolean.java "()" is missing after s.toLowerCase() (in public Boolean 
(String s) { ... }).

I've got another problem now, "theSocket.getInetAddress()" always return the
 same thing than "theSocket.getLocalAddress()".

sample:

import java.net.*;
import java.io.*;

public class getSocketInfo {

  public static void main(String[] args) {

    for (int i = 0; i < args.length; i++) {
      try {
        Socket theSocket = new Socket( args[i], 80);
        System.out.println("Connected to " + theSocket.getInetAddress() 
         + " on port "  + theSocket.getPort() + " from port " 
         + theSocket.getLocalPort() + " of " + theSocket.getLocalAddress());

      }  // end try
      catch (UnknownHostException e) {
        System.err.println("I can't find " + args[i]);
      }
      catch (SocketException e) {
        System.err.println("Could not connect to " + args[i]);
      }
      catch (IOException e) {
        System.err.println(e);
      }

   } // end for

  }  // end main

}  // end getSocketInfo


Is it possible to use "getInetAddress()" like that ?
Where is the problem ?
Thanks, 

Alice


More information about the kaffe mailing list