MAC OS 10.5.7 FireWall & Java Socket programing

Hi everyone,
I am fighting for few days with a simple problem in vain.
I am programming a simple java client-server application based on TCP sockets but I do not manage to open any socket at all due to a "connection refused" problem:
In the previous versions of MAC OS X Leopard it was possible to open communication port easily. The latest version of leopard no longer support this functionality. Now you can grant permission only to applications (not to java programs).
I tried the following:
Creating a script that starts my application and uses the firewall setup program to grant permission to that script: Impossible only application can be managed neither script nor JAR files are accepted.
Modifying low level firewall parameters using IPFW: useless the MAC firewall works at a lower level. changing local firewall rules does change anything.
I am thinking about modifying the /library/Java/Home/lib/java.security file but I think that it works only for Applets.
I try to grant permissions to the java executable file using the firewall configuration panel but the problem is still present.
I am sure that lots of programers had this problem.. Anyone have a simple solution ?
Thx for your time.
PS: here a simple code example of what I am doing.
try
socket = new Socket(InetAddress.getLocalHost(),port);
catch (UnknownHostException e)
e.printStackTrace();
and the output is:
java.net.ConnectException: Connection refused

I finally got around to rearranging and backing up partitions. Updated to 10.5.7 on a non live partition and then booted into it. Don't have any problems with CS3 ID, IL or PS. And no problem with CS4 ID, IL, PS. Does appear to have fixed the OpenGL problems with the NVIDIA GeForce 8800 GT video card and PSCS4. I will say on the main workstations I have not updated a live booted partition in years. Seems like there are nothing but problem trying to update a live partition.
As to the monitor profile being introduced into the RGB print flow from ID PS3 and 4. Problem still there and still not fixed. But of course you can use Print as Bitmap or if your running a Canon printer with selectable Fast Graphic Process in the driver you can print correct output this way.

Similar Messages

  • JAVA Socket Programming

    I have built a proxy server as a test harness and thankfully it all works. I can run clients on the same box or remote and they can connect to the proxy server and send messages onto the actual server that I want to process the client requests.
    Now this is all working, I have decided to work with a third party, who have a production proxy server. It uses the same protocol as my test harness.
    The issue:
    Though I can connect to their proxy server, when I use an Outputstream.write() to send the data from my side to them. My program indicates it is sent, i.e. no Exceptions thrown, but the other end do not receive anything. When I use the same IP Address and Port as the third party all works well for my proxy server.
    I know that the third party product is built using Microsoft C++, but I don't see any reason why there is no data actually getting to their port. They print a message as soon as they receive anything.
    Is there anything like encoding or 'end of line/stream' characters that need to be used?
    Thanks in advance

    Have you contacted the third party that developed the server? Or, are they closed on Saturdays?
    World spins
    RD-R
    � {�                                                                                                                                                                                                                                               

  • Java socket run on localhost against outside server

    Hi everyone,
    I am newbie to Java socket and networking. By spending this weekend over the internet reading and researching I have made my first Server-Client java socket program run sucessfully on my localhost 127.0.0.1. They can be connected and ok to communicate.
    However, when I put my server program to the LIVE server outside the network the client side says cannot connect to the server because: Connection Error, Connection refused: connect. So I read some stuff about firewall and NAT on the web but i was shamed that I don't understand there is any solution to this.
    It is great appreciated if someone can point me out how can I resolve this or make a step out because I am running out of time to give out the program against the deadline. But I really thank you anyone has been reading this.
    The server code:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package instantmessenger;
    import java.io.*;
    import java.net.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
        public class Server extends JFrame implements ActionListener {
            JTextArea textreceive   =new JTextArea();
            JTextArea textsend      =new JTextArea();
            JButton button          =new JButton("Send");
            BufferedReader in;
            PrintWriter out;
            public Server () {
                    //init   controls
                    setTitle("Server");
                    setBounds(50,50,500,400);
                    getContentPane().setLayout(null);
                    getContentPane().add(textreceive);
                    getContentPane().add(textsend);
                    getContentPane().add(button);
                    textreceive.setBounds(10,10,450,300);
                    textsend.setBounds(10,320,350,30);
                    button.setBounds(370,320,70,30);
                    button.addActionListener(this);
            public void listenClient() throws IOException {
                    ServerSocket   server=new   ServerSocket(9999);
                    System.out.println("start:"+server);
                    textreceive.append("start"+server+"\n");
                    try {
                            Socket s = server.accept();
                            try {
                                    System.out.println("connecting   :"+s);
                                    textreceive.append("connecting   :"+s+"\n");
                                    in = new BufferedReader(new InputStreamReader(s.getInputStream()));
                                        out=new   PrintWriter(
                                        new   BufferedWriter(
                                        new   OutputStreamWriter(s.getOutputStream())));
                                    out = new PrintWriter(s.getOutputStream());
                                    String str=null;
                                    while(true) {
                                            str = in.readLine();
                                            System.out.println(str);
                                            textreceive.append(str+"\n");
                            finally {
                                s.close();
                    finally {
                        server.close();
            } // end function
            public void actionPerformed(ActionEvent event) {
                    String str = textsend.getText();
                    if( !str.equals("")) {
                            out.println(textsend.getText());
                            //out.println(textsend.getText());
                            out.flush();
                            textreceive.append(textsend.getText()+"\n");
                            textsend.setText("");
            } // end function
            public   static   void   main(String   args[])   throws   IOException {
                Server   s=new   Server();
                s.show();
                s.listenClient();
            } // end function
        } // end classThe client source code:
    package instantmessenger;
        import   java.net.*;
        import   java.io.*;
        import   javax.swing.*;
        import   java.awt.*;
        import   java.awt.event.*;
        public   class   Client   extends   JFrame implements   ActionListener {
            JTextArea   textreceive=new   JTextArea();
            JTextArea   textsend   =new   JTextArea();
            JButton     button   =new   JButton   ("Send");
            BufferedReader  in;
            PrintWriter     out;
            public Client(){
                    //init   controls
                    setTitle("Client");
                    setBounds(50,50,500,400);
                    getContentPane().setLayout(null);
                    getContentPane().add(textreceive);
                    getContentPane().add(textsend);
                    getContentPane().add(button);
                    button.addActionListener(this);
                    textreceive.setBounds(10,10,450,300);
                    textsend.setBounds(10,320,350,30);
                    button.setBounds(370,320,70,30);
           } // init
            public void startNet() throws IOException {
                  //Socket client=new Socket("localhost",9999);
                  Socket client=new Socket("222.33.444.5555",9999);  // NOT REAL SERVER IP
                  try {
                          System.out.println("Socket="   +client);
                          in    =   new BufferedReader(new InputStreamReader(client.getInputStream()));
                          out   =   new PrintWriter(new BufferedWriter(new OutputStreamWriter(client.getOutputStream())),true);
                          String str=null;
                          while(true) {
                              str   =   in.readLine();
                              System.out.println(str);
                              textreceive.append(str+"\n");
                  finally {
                        client.close();
            } // end function
            public void actionPerformed(ActionEvent   event) {
                String str=textsend.getText();
                if(!str.equals("")) {
                    out.println(textsend.getText());
                    //out.println(textsend.getText());
                    out.flush();
                    textreceive.append(textsend.getText()+"\n");
                    textsend.setText("");
            } // function
            public static void main(String args[]) throws IOException {
                Client c=new Client();
                c.show();
                c.startNet();
            } // function
    } // end classThank you
    Morris Lee

    However, when I put my server program to the LIVE server outside the network the client side says cannot connect to the server because: Connection Error, Connection refused: connect. So I read some stuff about firewall and NAT on the web but i was shamed that I don't understand there is any solution to this.What do you want us to do? You already know that the problem probably is that you need to open port 9999 in the firewall, and you probably also need to configure it for port forwarding.
    Most clients will be able to connect after that, but some might still have problems. E.g. some companies don't allow clients to connect to other ports than a few well known ones (e.g. 21, 80 and 443)

  • How to control tcp connection with java tcp socket programing ??

    Hi,
    I am connecting a server as using java socket programming.
    When server close the connection (socket object) as using close() method ,
    I can not detect this and My program continue sending data as if there is a connection with server.
    How to catch the closing connection ( socket ) with java socket programming.
    My Client program is as following :
    import java.io.PrintWriter;
    import java.net.Socket;
    public class client
      public client()
       * @param args
      public static void main(String[] args)
        Socket socket=null;
        PrintWriter pw=null;
        try
                          socket = new Socket("localhost",5555);
                          pw = new PrintWriter(socket.getOutputStream(),true);
                          int i=0;
                          while (true)
                            i++;
                            pw.println(i+". message is being send.");
                            Thread.sleep(5000);
        } catch (Exception ex)
                          ex.printStackTrace();
        } finally
                          try
                            if(pw!=null)pw.close();
                            if(socket!=null)socket.close();
                          } catch (Exception ex)
                            ex.printStackTrace();
                          } finally
    }

    I changed the code as following. But I couldn't catch the EOFException when I read from the socket. How can I catch this exception ?
    import java.io.BufferedReader;
    import java.io.EOFException;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.Socket;
    import java.net.UnknownHostException;
    public class client
      public client()
       * @param args
      public static void main(String[] args)
        Socket socket=null;
        PrintWriter pw=null;
        BufferedReader bufIn=null;
        InputStreamReader inRead=null;
        InputStream in=null;
        try
                          socket = new Socket("localhost",5555);
                          in = socket.getInputStream();
                          inRead = new InputStreamReader(in);
                          bufIn = new BufferedReader(inRead);
                          pw = new PrintWriter(socket.getOutputStream(),true);
                          int i=0;
                          while (true)
                            i++;
                            try
                              bufIn.readLine();
                              pw.println(i+". message is being send.");
                              System.out.println(i+". message has been send");
                            } catch (Exception ex2)
                              System.out.println(ex2.toString());
                              System.out.println(i+". message could not be send");
                            } finally
                            Thread.sleep(5000);
        } catch (EOFException ex)
                          ex.printStackTrace();
        } catch (InterruptedException ex)
                          ex.printStackTrace();
        } catch (IOException ex)
                          ex.printStackTrace();
        } finally
                          try
                            if(pw!=null)pw.close();
                            if(socket!=null)socket.close();
                          } catch (Exception ex)
                            ex.printStackTrace();
                          } finally
    }

  • Java sockets forwarding (redirect)

    Dear all
    I’m try to write a java sockets program which will accept VNC connection and forward it to another pc that has VNC server installed.
    That is: a client use vnc viewer connect to a JavaServer(where the sockets program run), the JavaServer accept this connection and forward it to the VNC server
    The reason doing this is because the client can only connect to the JavaServer, and the JavaServer has the ability to connect any host.
    I can manage to initiate the connection, and give the password that the VNC server request with the following code, but after this just before the viewer start to show the remote desktop, the sockets stuck on reading.
    can anyone help me out please.
    public void listen() throws Exception
    ServerSocket server=new ServerSocket(443, 5);
    System.out.println("Start Listen ...");
    while(true)
    Socket serverCon=server.accept();
    System.out.println("get Connection from: "+serverCon.getInetAddress());
    InputStream serverIn=serverCon.getInputStream();
    OutputStream serverOut=serverCon.getOutputStream();
    Socket targetCon=new Socket("192.168.1.3", 5900);
    InputStream targetIn=targetCon.getInputStream();
    OutputStream targetOut=targetCon.getOutputStream();
    byte[] buf=new byte[10240];
    int len;
    while(true)
    len=targetIn.read(buf);
    System.out.println(len);
    serverOut.write(buf, 0, len);
    len=serverIn.read(buf);
    System.out.println(len);
    targetOut.write(buf, 0, len);
    }

    Hi EJP
    Thanks for your reply,
    I did try to use threads with pipeStream,
    but it’s worse than the simple one,
    since it cannot even initiate connect between two side,
    the following is the sample code I use, which I leaned from here http://home.tiscali.nl/bmc88/java/sbook/029.html
    I can't found any more info regard to this topic on the internet, can you give me a hint.
    thanks a lot.
    public void listen2() throws Exception
      ServerSocket server=new ServerSocket(443, 5);
      System.out.println("Start Listen ...");
      while(true)
       Socket serverCon=server.accept();
       System.out.println("get Connection from: "+serverCon.getInetAddress());
       InputStream serverIn=serverCon.getInputStream();
       OutputStream serverOut=serverCon.getOutputStream();
       Socket targetCon=new Socket("192.168.1.1", 5900);
       InputStream targetIn=targetCon.getInputStream();
       OutputStream targetOut=targetCon.getOutputStream();
       PipedInputStream serverPin=new PipedInputStream();
       PipedOutputStream serverPout=new PipedOutputStream(serverPin);
       PipedInputStream targetPin=new PipedInputStream();
       PipedOutputStream targetPout=new PipedOutputStream(targetPin);
       while(true)
        ReadThread rt=new ReadThread("reader", targetIn, serverPout);
        ReadThread wt=new ReadThread("writer", serverPin, serverOut);
        ReadThread rt2=new ReadThread("reader", serverIn, targetPout);
        ReadThread wt2=new ReadThread("writer", targetPin, targetOut);
        rt.start();
        wt.start();
        rt2.start();
        wt2.start();
    class ReadThread extends Thread implements Runnable{
      InputStream pi=null;
      OutputStream po=null;
      String process=null;
      ReadThread(String process, InputStream pi, OutputStream po)
       this.pi=pi;
       this.po=po;
       this.process=process;
      public void run()
       byte[] buffer=new byte[1024];
       int bytes_read;
       try
        for(; ; )
         bytes_read=pi.read(buffer);
         if(bytes_read==-1)
          return;
         po.write(buffer, 0, bytes_read);
       catch(Exception e)
        e.printStackTrace();
    }

  • Problem while reading data on java socket

    Hi All,
    I am in big problem based on java socket programming. I run my application and start a ServerSocket on 10000(suppose) port no.As soon as request is coming i create a new thread with Socket assigned to it and process the request. Now i got the response and written on same Socket(Listen to ServerSocket on 10000 port). Now what i want to read the response written earlier on Socket.The written response i print on SOP it is visible. But when i establish InputStream and try to read the data it gives me -1 means no data is available. But i have seen the SOP and data is written to socket. How can solve the problem. I have tried after close the Socket as well as not close the socket.
    Please help me out on this.see below code
    <CODE>
    void upperClassMethod() {
    istener = new ServerSocket(port);
    while(true) {
    clientSocket = listener.accept();
    doComms conn_c= new doComms(clientSocket);
    Thread t = new Thread(conn_c);
    t.start();
    //doComms is a inner class of upper level class
    class doComms implements Runnable {
              private Socket server;
              doComms(Socket server) {
                   //pp = server;
                   this.server=server;
                   //server=server1;
    void processResponse() {
              try {
                   BufferedInputStream in = new BufferedInputStream (clientSocket.getInputStream());
                   byte [] inBuff = new byte [4096] ;
                   int len = in.read (inBuff, 0, inBuff.length) ;
                   String output = new String (inBuff) ;
                   System.out.println("the output is :::: "+output);
              } catch(Exception e) {
                   e.printStackTrace();
    </CODE>
    in processResponse() method i am not able to get output. Plz help me guys.....
    Thanks in advance for ant assistance
    Regards,
    Pradeep

    please see mu rum nethos of doComms class
    <CODE>
    public void run () {
                   input="";
                   boolean done = false ;
                   try {
                        BufferedInputStream in = new BufferedInputStream (server.getInputStream());
                        out = new PrintStream(server.getOutputStream());
                        while (!done) {
                             byte [] inBuff = new byte [4096] ;
                             try {
                                  int len = in.read (inBuff, 0, inBuff.length) ;
                                  if (len > 0) {
                                       input = new String (inBuff) ;
                                       Runnable r = new RequestProcessThread();
                                       Thread t = new Thread(r);
                                       t.start();
                                  } else if (len == -1) {
                                       done = true ;
                                       //server.close () ;
                             catch (InterruptedIOException iioe) {
                   } catch (IOException ioe) {
                        System.out.println("IOException " + ioe + " on socket in thread: " + Thread.currentThread().getName());
                        ioe.printStackTrace();
                        done = true ;
    </CODE>

  • [Urgent]3G Socket programming

    May I use socket for 3G networks?
    I use the demo provided by the WTK2.5-Beta(NetworkDemo), it works well in the simulator. However, when I download the program to the mobile phone, it seems that the mobile phone that runs ServerSocket cannot create the socket ... all the 2 handsets use a 3G SIM card provided by a Hong Kong ISP smartTone ... What can I do?
    Please help~ provide any web page of codes, thanks very much!

    1.     We want to create a socket connection which can
    remain open and live for ever till it is closed. Is
    this possible in java socket programming?Yes, but it isn't practical in the real networking world. So your code had better be prepared to deal with network failures.
    2.     I am just wondering in order to communicate with
    the third party over the socket connection, does this
    other party requires to run something specific on
    their end? I am not able to understand how will my
    java code communicate with their server otherwise.It has nothing to do with java. Sockets send and recieve messages. The applications at either end, regardless of the language that they are written in, must handle those messages.
    3.     Can we send and receive data over the socket
    created and also is their specific format for the
    data? Yes.
    Can we send files of data over this connection?Yes. (Although I don't know why you would need to do that if you are doing credit card auths.)
    It would be great if someone can comment on these
    questions and also if possible please provide some
    code that can create socket connection.The tutorial.....
    http://java.sun.com/docs/books/tutorial/networking/sockets/index.html

  • First Very Simple Socket Program

    Hello,
    I am learning about Sockets and ServerSockets and how I can use the. I am trying to make the simplest server/client program possible just for my understanding before I go deper into it. I have written two programs. theserver.java and theclient.java the sere code looks like this....
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class theserver
      public static void main(String[] args)
      {   //  IOReader r = new IOReader();
            int prt = 3333;
            BufferedReader in;
             PrintWriter out;
            ServerSocket serverSocket;
            Socket clientSocket = null;
    try{
    serverSocket = new ServerSocket(prt);  // creates the socket looking on prt (3333)
    System.out.println("The Server is now running...");
    while(true)
        clientSocket = serverSocket.accept(); // accepts the connenction
        clientSocket.getKeepAlive(); // keeps the connection alive
        out = new PrintWriter(clientSocket.getOutputStream(),true);
        in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
         if(in.ready())
         System.out.println(in.readLine()); // print it
    catch (IOException e) {
        System.out.println("Accept failed:"+prt);
    }and the client looks like this
    import java.net.*;
    import java.io.*;
    public class theclient
    public static void main(String[] args)
        BufferedReader in;
        PrintWriter out;
        IOReader r = new IOReader();
        PrintWriter sender;
        Socket sock;
      try{
        sock = new Socket("linuxcomp",3333);  // creates a new connection with the server.
        sock.setKeepAlive(true); // keeps the connection alive
        System.out.println("Socket is connected"); // confirms socket is connected.
        System.out.println("Please enter a String");
         String bob = r.readS();
          out = new PrintWriter(sock.getOutputStream(),true);
        out.print(bob); // write bob to the server
      catch(IOException e)
           System.out.println("The socket is now disconnected..");
    }If you notice in the code I use a class I made called IOReader. All that class is, is a buffered reader for my System.in. (just makes it easier for me)
    Ok now for my question:
    When I run this program I run the server first then the client. I type "hello" into my system.in but on my server side, it prints "null" I can't figure out what I am doing wrong, if I am not converting correctly, or if the message is not ever being sent. I tried putting a while(in.read()) { System.out.println("whatever") } it never reaches a point where in.ready() == true. Kinda of agrivating. Because I am very new to sockets, I wanna aks if there is somthing wrong with my code, or if I am going about this process completely wrong. Thank you to how ever helps me,
    Cobbweb

    An example of Creating a Client Socket (Java socket programming tutorial)
    try {
            InetAddress addr = InetAddress.getByName("hotdir.biz");
            int port = 80;
            // This constructor will block until the connection succeeds
            Socket socket = new Socket(addr, port);
        } catch (UnknownHostException e) {
        } catch (IOException e) {
        // Create a socket with a timeout
        try {
            InetAddress addr = InetAddress.getByName("hotdir.biz");
            int port = 80;
            SocketAddress sockaddr = new InetSocketAddress(addr, port);
            // Create an unbound socket
            Socket sock = new Socket();
            // This method will block no more than timeoutMs.
            // If the timeout occurs, SocketTimeoutException is thrown.
            int timeoutMs = 2000;   // 2 seconds
            sock.connect(sockaddr, timeoutMs);
        } catch (UnknownHostException e) {
        } catch (SocketTimeoutException e) {
        } catch (IOException e) {
        }See socket tutorial here http://www.developerzone.biz/index.php?option=com_content&task=view&id=94&Itemid=36

  • Socket Programming-Not getting response from server.

    Hi,
    I am trying to communicate with server using java socket programming, I am getting the response for first two times third time when I am trying to write some thing I am not getting any response from the server,
    I am writing to migrate the vb code to Java the vb is using a c++ dll to communicate with the server and we tried accessing the dll from java using JNI then it is working fine, this dll is dependent on windows so we want to avoid the dependency with windows that is why we are going for socket programming, Please help on this.

    Hi,
    I am writing the data in forms of string
    like
    Socket sockt = new Socket(ipAddress, portNo);     
    out= new DataOutputStream(sockt.getOutputStream());
    in = new DataInputStream(sockt.getInputStream());
    out.writeBytes("Serv");
    out.writeBytes("Serv,32");
    out.writeBytes("home,serv32,run.prg,sucess");
    these are the strings to communicate with server.
    I am trying to read the same
    StringBuffer buf = new StringBuffer();
              byte b = '\0';
                        try {
                   while ((b = in.readByte()) != '\0')
                        char ch = (char) b;
                        buf.append(ch);
              } catch (Exception e) {
                   System.out.println(e.getStackTrace());
    we are getting the response for the first two strings, but for the third string it is getting stucked for some time and returing some junk values like '???' we are sending the same string using JNI and it is working.

  • Socket Programing

    Hi,
    I am trying to write code for Telnet Client from Java Socket Program.
    Following is the code sample.
    Socket socketClient = new Socket("1.1.1.1",23);
    PrintStream out = new PrintStream(socketClient.getOutputStream());
    BufferedReader in = new BufferedReader(new InputStreamReader(socketClient.getInputStream()));
    But when I read using in.read() I get 255,34 ....so on and 39 and program just stops..
    I am not getting the login screen.
    Any suggestions please .......
    Regards,

    user13818968 wrote:
    Any suggestions please .......Read the documentation of Telnet Protocol.

  • Any socket programming sample program or API for transfer file?

    Do there any java socket programming sample program or API for transfer file ,list file and make directory from client side?
    Thank you

    http://forum.java.sun.com/thread.jspa?threadID=603685&tstart=0

  • Raw socket programming  is avilable in java

    hello,
    I want to reset my target device using device
    MAC address (not IP address).
    Is java support raw socket programming.
    can i send packets using MAC address in Java like C.
    I search in google. but, it shows there is no raw socket pgm support in java.
    any one help me this issue.

    JPCap

  • Java socket not handling the data packets properly

    I have created a small webserver application where i am receiving http requests from a siebel client. I am using content-length parameter to read the complete data in a buffer string using the command inputstreamreader.read. It works fine in all the cases, except when its used with a firewall. Some times the firewall splits a message into 2 and my logic fails as it doesn't find as many characters in the first packet as mentioned in the content length.
    My question is , how can i take care of these scenarios where a firewall is splitting the messages into multiple packets. why the java socket class is not handling the merging of these packets?
    any pointers are welcome.
    thanks

    Because that's the way TCP/IP works. read() gives you the data it can, and tells you how much was actually read. It's up to the application to reconstruct the application-level object. You could do something like this:    byte[] content = new byte[contentLen];
        int offset = 0;
        int remaining = contentLen;
        int currBytesRead = 0;
        while (remaining > 0 && currBytesRead != -1) {
          int currBytesRead = mySocketInputStream.read(content, offset, remaining);
          remaining -= currBytesRead;
          offset += currBytesRead;
        } (Warning: that's off the top of my head, uncompiled and untested. Use for demonstration purposes only!)
    Grant

  • Java Socket Constructor

    Hi All:
    We all know that "Socket(String host, int port)" create a client socket which connecting to
    the target host : port
    however, which local port does it connect from? I guess it must be a random port from list of
    available ports. but how can we find out which port is currently been used?
    I thought another constructor Socket(InetAddress address, int port, InetAddress localAddr, int localPort)
    might help. but the following code :
    " Socket connection = new Socket("www.google.com", 80, InetAddress.getByName("localhost"), 0);"
    doesn't work either. can anyone spot the problem please

    0 means ANY currently available port, what's wrong with choosing 0 to be the port number?
    just because is not documented on the Java documentation? read http://books.google.co.uk/books?id=NyxObrhTv5oC&dq=java+network+programming&pg=PP1&ots=1d9JyFUpRY&sig=HPm47jAWjRHrMpZw0UTG2nM86bA&hl=en&prev=http://www.google.co.uk/search?hl=en&q=java+network+programming&btnG=Google+Search&sa=X&oi=print&ct=title&cad=one-book-with-thumbnail#PPA281,M1
    before even recommend your so-called better book. by the way it was a firewall issue.I 'v got it solved now.
    may be "didn`t work" is not efficient word to explain things, but it is better then
    someone wrote down full of c.r.a.p, without saying anything useful at all.
    I don`t understand why my question doesn`t make any sense. choosing random port at runtime rather then
    giving a specific number, is a common programming technique, I thought it making a GREAT sense.
    Edited by: Shanyangqu on Jan 21, 2008 3:38 AM

  • Mac Os X 10.6.8 Java update

    Hi,
    Recently I cannot run Java applications for my work. Where it worked before, it doesn't anymore.
    It shows the message inactive Plug-in. When I click on it Mac start searching for updates but says everything is up-to-date, so that doesn't resolve anything.
    I enabled all the options for Java in security preference in Safari. Also enabled applet Plug-in and Web start applications in Java preferences.

    The recently released Java 7 Update 11 has been blocked by Apple through its XProtect anti-malware feature in OS X.
    Oracle issued the latest update to Java earlier this month to fix a serious zero-day security flaw. The threat was so serious that the U.S. Department of Homeland Security had recommended that all Java 7 users disable or uninstall the software until a patch was issued.
    Apple took action on its own and quietly disabled the plugin through its OS X anti-malware system. And as noted by MacGeneration on Thursday, Apple has again updated its OS X XProtect list, this time to block Java 7 Update 11.
    Because Oracle has yet to issue a newer version of Java that addresses any outstanding issues, Mac users are prevented from running Java on their system.
    Over the last few years, Apple has moved to gradually remove Java from OS X. The Mac maker dropped the Java runtime from the default installation for OS X 10.7 Lion when the operating system update launched in 2010. Java vulnerabilities have been a common exploit used by malicious hackers looking to exploit the OS X platform.
    Most notably, the "Flashback" trojan that spread last year was said to have infected as many as 600,000 Macs worldwide at its peak. Apple addressed the issue by releasing a removal tool specifically tailored for the malware, and also disabled the Java runtime in its Safari web browser starting with version 5.1.7.
    Javascript should not be disabled (it has nothing to do with Java).

Maybe you are looking for