1 Reply Latest reply on Nov 4, 2008 4:42 AM by 807589

    socket programming -- check server socket open or not


      im doing a socket program, where the user needs to enter the IP address... will the following code actually test if the socket is open?

      else, wat API must i use to test if the socket is open?

      public static String getIPAddress(){
      //prompts user to enter an ip address, port is fixed
      public static void tryConnection(String ipAddress){
              Socket sock = new Socket(ipAddress, 65500);    
              bool sockIsConnected = sock.isConnected();
          catch(Exception err){
              System.err.println("Error" + err);